Autonav: don’t show home link on home page?
Permalink
I haven’t found anything covering this so I’m gonna start a new thread:
Is there any way do exclude the home page link from the home page ONLY? I know I could do this with CSS but that’s not an option as it would mess with the styling of the menu (I’m using the :first-child pseudo class fo different styling and a hidden element isn’t equal to a non-existent/removed element).
“Exclude from nav” would hide the link on all pages but I just want it to not show up on the home page (since that’s redundant). What’s the way to do this?
Is there any way do exclude the home page link from the home page ONLY? I know I could do this with CSS but that’s not an option as it would mess with the styling of the menu (I’m using the :first-child pseudo class fo different styling and a hidden element isn’t equal to a non-existent/removed element).
“Exclude from nav” would hide the link on all pages but I just want it to not show up on the home page (since that’s redundant). What’s the way to do this?
I’m sorry to bump this thread but doesn’t anybody have an idea if and how this is possible? I’ve already tried to mess with the auto-nav settings such as just displaying pages from one level below (since in the sitemap the home page is parent of everything) but somehow the home page seems to be a special case.
you would have to create a custom template
Since this question is from 2010, I just wanted to drop in and see if you worked this out. It's something I'm trying to do today.
The home page does seem to be treated like a special case wherein it is both "top" and a parent to all those pages. I found the simplest solution was to use CSS to hide that menu element.
I put my nav controller in the template as such:
And then used the following CSS:
Poof! Gone. I don't think this is the *neatest* way of solving the problem because you transmitting useless markup, but it is effective.
I put my nav controller in the template as such:
<ul class="nav"> <?php $nav = BlockType::getByHandle('autonav'); $nav->controller->orderBy = 'display_asc'; $nav->controller->displayPages = 'top'; $nav->controller->displaySubPages = 'all'; $nav->controller->displaySubPageLevels = 'custom'; $nav->controller->displaySubPageLevelsNum = 1; $nav->render('templates/header_menu.php'); ?> </ul>
And then used the following CSS:
ul.nav li:first-child { display: none; }
Poof! Gone. I don't think this is the *neatest* way of solving the problem because you transmitting useless markup, but it is effective.
You could also enable classes in your autonav template, add a class name in the Properties tab, and then use the "Header Extra Content" property on the homepage to hide the style. That way the css is only loaded on the one page.