Unable to include navigation on site

Permalink
I have just loaded my site up and came to add Auto-Nav to my navigation area but was not offered input to add a block. Any ideas?

<nav>
        <?php
          $ga = new GlobalArea('Navigation');
          $block_count = $ga->getTotalBlocksInArea($c);
          if ($block_count > 0 || $c->isEditMode()) {
          $ga = new GlobalArea('Navigation');
          $ga->setBlockLimit(1);
      $ga->display($c);
          }
       ?>
</nav>

sutwald
 
studio4graphics replied on at Permalink Reply
Hi,

If you try the following:
<?php 
$a = new GlobalArea('Auto Nav');
$a->setBlockLimit(1);
$a->display( ); 
?>


Or maybe hardcoding it into the template is an option?:
<?php
   $nav = BlockType::getByHandle('autonav');
   $nav->controller->orderBy = 'display_asc';
   $nav->controller->displayPages = 'top';
   $nav->controller->displaySubPages = 'none';
   $nav->controller->displaySubPageLevels = 'custom';
   $nav->controller->displaySubPageLevelsNum = 1;
   $nav->render('templates/YOURTEMPLATENAME');
?>
sutwald replied on at Permalink Reply
sutwald
Just noticed that you have disabled the sub level pages in the code snipet. Is there some way I can over ride this to allow all levels to show?

$nav->controller->displaySubPages = 'none';
$nav->controller->displaySubPageLevels = 'custom';
$nav->controller->displaySubPageLevelsNum = 1;
studio4graphics replied on at Permalink Best Answer Reply
sutwald replied on at Permalink Reply
sutwald
Thank you.
studio4graphics replied on at Permalink Reply
Can you mark my answer as best answer. Thanks