Database getRepository and BlockTypes

Permalink
I've got two menus hardcoded in my template:

$bt = BlockType::getByHandle('autonav');
$bt->controller->displayPages = 'top';
$bt->render('main');
$bt = BlockType::getByHandle('autonav');
$bt->controller->displayPages = 'second';
$bt->render('second);


However, they both output the same!

I dug into the code and saw the BlockType::getByHandle() using a getRepository function. That's probably caching the BlockType (including controller). Because the controller is then set, it will not instantiate a new one (which is normally done in "BlockType / loadController").

I haven't found a way to bypass this issue.

Any ideas?
Thanks, Adri

A3020
 
JohntheFish replied on at Permalink Reply
JohntheFish
There was a thread on similar yesterday. the nav array inside the block is persistent and needs to be cleared.
http://www.concrete5.org/community/forums/5-7-discussion/hardcode-s...
A3020 replied on at Permalink Reply
A3020
Thanks John, I had not seen that topic.