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

GBNT
 
GBNT replied on at Permalink Best Answer Reply
GBNT
Got it. :)

had to update the form setup as well.

All good.
yasioo replied on at Permalink Reply
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?
GBNT replied on at Permalink Reply
GBNT
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:
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;


I already inserted the fourth level so you should be good to go..
yasioo replied on at Permalink Reply
Thanks a lot. Of course it works like a charm.