Embedded auto nav

Permalink 1 user found helpful
I'm in the midst of my first custom C5 theme.

What's the best way to embed the auto nav functionality into the theme, so that I don't have to add an auto nav through the CMS?

Also, what's the best way to accomplish this with sub-nav areas that show all sub pages of the current page?

bengenares
 
tek01 replied on at Permalink Reply
Hi, i put my navigation in the global scrapbook, then i hardcode it in my header.php.
bengenares replied on at Permalink Reply
bengenares
How do you hard code it in your header?
tek01 replied on at Permalink Best Answer Reply
<?php
$block = Block::getByName('Menu top');
if (is_object($block))
$block->display();
?>


Where 'Menu top' is the name of the block in the global scrapbook.
bengenares replied on at Permalink Reply
bengenares
Thanks. That worked great. Now do you know how to add functionality to the block, so that it puts a class name in a li or anchor to indicate the current page?
tek01 replied on at Permalink Reply
Auto nav block automatically uses the class="nav-selected" to the li and the a.
bengenares replied on at Permalink Reply
bengenares
Ah, I see that now. I think I had to exit "edit mode" to see the classes. Thanks!