Nav-Path-Selected

Permalink
I'm trying to utilize the nav-path-selected on autonavs. I use a built-in, non-editable auto-nav in my themes with:

<?php 
$bt_main = BlockType::getByHandle('autonav'); 
$bt_main->controller->displayPages = 'top'; 
$bt_main->controller->orderBy = 'display_asc';                     
$bt_main->controller->displaySubPages = 'none';                     
$bt_main->render('templates/level1'); 
?>


But I would like whatever path that I've got selected to be styled with the nav-path-selected class, but it always has the home page with the nav-path-selected class as well. Is there any way that I can only have the home page in the nav-path-selected class if the page itself is selected?

WebSolutions
 
Shotster replied on at Permalink Best Answer Reply
Shotster
$pg = Page::getCurrentPage();
foreach ($aBlocks as $ni) {
   if ($pg->getCollectionID() == HOME_CID) {
      // We're on the home page
   }
   if ($ni->getCollectionID() == HOME_CID) {
      // We've got the home nav item
   }
}

-Steve
Shotster replied on at Permalink Reply
Shotster
To clarify... The code I posted above would be in a custom autonav template.

-Steve
WebSolutions replied on at Permalink Reply
WebSolutions
Thanks Shotster,

Can I hard-code the fact that I want to use a custom template into my template? I.E. Using the example above, how could I tell it to use this custom template?