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?
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?
Hi, i put my navigation in the global scrapbook, then i hardcode it in my header.php.
How do you hard code it in your header?
<?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.
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?
Auto nav block automatically uses the class="nav-selected" to the li and the a.
Ah, I see that now. I think I had to exit "edit mode" to see the classes. Thanks!