Core Overrides again

Permalink
this file is controllers/blocks/autonav.php
defined('C5_EXECUTE') or die("Access Denied.");
    class Concrete5_Controller_Block_Autonav extends BlockController
    {
    }
   class Concrete5_Controller_Block_Autonav_Override extends Concrete5_Controller_Block_Autonav
   {
      public function getNavItems($ignore_exclude_nav = false) {
         $c = Page::getCurrentPage();
            // SINIPPED code
            ...
            //Is Mega Menu
            $is_mega_menu = $_c->getAttribute('is_mega_menu');
            ...
            $navItem->isMegaMenu = $is_mega_menu;
            ...


extending BlockController with Concrete5_Controller_Block_Autonav,
overriding Concrete5_Controller_Block_Autonav with Concrete5_Controller_Block_Autonav_Override

# concrete5 Version
5.6.1.2
# concrete5 Overrides
blocks/autonav, controllers/blocks, languages/site, languages/tr_TR, themes/felis, themes/felis3

Environment Information shows the core override, but no way, it does not work.
in overriding template under /blocks/autonav/templates/main_menu.php

if ($ni->isMegaMenu)
   {
      echo '<h1>asdfasdf</h1>'; exit;
   }


Attribute handle is is_mega_menu which is set to $navItem->isMegaMenu in autonav.php override. One of the pages is set to is_mega_menu => Yes.
Core Overrides cache is off
Block Cache is off
Full Page Cache is off,
Yes, cache is cleaned a hundred times.

tolga
 
jshannon replied on at Permalink Reply
jshannon
You don't need override in the class name.

You can give it the same class name as exists in /concrete/blocks/autonav/controller.php (i think i'm right here, but i'm definitely close).

That class is called AutonavBlockController , so that's what you should name yours.

Lastly, that class should be at /blocks/autonav/controller.php
jshannon replied on at Permalink Reply
jshannon