Weird Autonav Issue

Permalink
Hi, I hope this hasn't been covered already in the forums, if it has I plead forgiveness and newby amnesty. I did look and couldn't find it.

Here is the issue I'm having. I'm making a site that uses a megamenu, and I'm hard coding the autonav, using custom display all children of specific page settings. It seems to be basically working, but with one weird bug. There are two instances of the autonav, and the second one is diplaying the right sub-pages as well as the sub-pages of the previous autonav. I know that's confusing, so look at the attached screenshot and my code below to see what I'm saying:

Here is the code for the first nav block (the one under (our ministries)
<?php
   $autonav = BlockType::getByHandle('autonav');
   $autonav->controller->orderBy = 'display_asc';
   $autonav->controller->displayPages = 'custom';
   $autonav->controller->displayPagesCID = '146';
    $autonav->render('templates/header_menu');
   ?>


And here is the code for the second: (Under Leadership):
<?php
         $Rautonav2 = BlockType::getByHandle('autonav');
         $Rautonav2->controller->orderBy = 'display_asc';
         $Rautonav2->controller->displayPages = 'custom';
          $Rautonav2->controller->displayPagesCID = '154';
         $Rautonav2->render('templates/header_menu');
         ?>


I thought that maybe the variable name was causing the problem, which is why the second code block has the googy $Rautonav2 variable name.

Oh, this in on 5.7.0.1

1 Attachment

pastorryanhayden
 
karladidas replied on at Permalink Reply
karladidas
Hi, the same issue is talked about here:

http://www.concrete5.org/community/forums/5-7-discussion/hardcode-s...

I found a fix but it isn't ideal.