How to override the autonav controller?

Permalink
Hi guys,

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

A3020
View Replies: View Best Answer
A3020 replied on at Permalink Reply
A3020
*bump*
andrew replied on at Permalink Reply
andrew
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.
A3020 replied on at Permalink Best Answer Reply
A3020
Ah found it. It should be:
namespace Application\Block\Autonav;
class Controller extends \Concrete\Block\Autonav\Controller
{
}