How to override the autonav controller?
Permalink
Hi guys,
any idea how to override the autonav controller in c57?
I came up with:
And want to hardcode the autonav in a template file:
I'm unsure what to put in /application/config/app.php. Any help would be appreciated!
Thanks, Adri
any idea how to override the autonav controller in c57?
I came up with:
<?php namespace Application\Blocks\Autonav; class Controller extends Concrete\Blocks\Autonav\Controller { function __construct($obj = null) { parent::__construct($obj); exit("ok"); } }
And want to hardcode the autonav in a template file:
$bt = BlockType::getByHandle('autonav'); $bt->controller->displayPages = 'top'; $bt->render('templates/main_menu');
I'm unsure what to put in /application/config/app.php. Any help would be appreciated!
Thanks, Adri
*bump*
That should be sufficient. I don't think you'd need to do anything else. You just need to make sure that controller is found in applications/block/autonav/ and that your override cache is turned off in the dashboard.
Ah found it. It should be:
namespace Application\Block\Autonav; class Controller extends \Concrete\Block\Autonav\Controller { }