Autonav 4th level (fourth level)
Permalink 1 user found helpful
I'm trying to add a 4th level to the autonav block, I'm doing it because as I have Internationalization, the top level becomes the 2nd, and now I'm one level short for my layout.
I tried simply adding to the the controller:
case 'fourth_level':
$cParentID = $this->getParentAtLevel(4);
break;
but that doesn't do anything...
Anyone know a solution?
Thanks.
T
I tried simply adding to the the controller:
case 'fourth_level':
$cParentID = $this->getParentAtLevel(4);
break;
but that doesn't do anything...
Anyone know a solution?
Thanks.
T
Hi,
I'm trying do it also. In form setup I already add an option but I still have a problem with controller. In which file you inserted a code? When I paste in controller.php, I've got an error. Probably I'm doing something wrong, but what?
I'm trying do it also. In form setup I already add an option but I still have a problem with controller. In which file you inserted a code? When I paste in controller.php, I've got an error. Probably I'm doing something wrong, but what?
In the new version of C5, the controllers changed a bit.
Create this folder: /blocks/autonav
Copy /concrete/blocks/autonav/controller.php and /concrete/blocks/autonav/form.php to the above folder and edit those.
You already edited the form so I'll skip that one..
In controller.php, you need to paste in between the brackets of:
class AutonavBlockController extends Concrete5_Controller_Block_Autonav { *HERE }
this whole function:
I already inserted the fourth level so you should be good to go..
Create this folder: /blocks/autonav
Copy /concrete/blocks/autonav/controller.php and /concrete/blocks/autonav/form.php to the above folder and edit those.
You already edited the form so I'll skip that one..
In controller.php, you need to paste in between the brackets of:
class AutonavBlockController extends Concrete5_Controller_Block_Autonav { *HERE }
this whole function:
function generateNav() { if (isset($this->displayPagesCID) && !Loader::helper('validation/numbers')->integer($this->displayPagesCID)) { $this->displayPagesCID = 0; } $db = Loader::db(); // now we proceed, with information obtained either from the database, or passed manually from $orderBy = ""; /*switch($this->orderBy) { switch($this->orderBy) { case 'display_asc': $orderBy = "order by Collections.cDisplayOrder asc"; break; case 'display_desc': $orderBy = "order by Collections.cDisplayOrder desc"; break;
Viewing 15 lines of 134 lines. View entire code block.
I already inserted the fourth level so you should be good to go..
Thanks a lot. Of course it works like a charm.
had to update the form setup as well.
All good.