Build Autonav in Template - only show pages beneath home

Permalink
HI,

I want to add an autonav block to my template. I have done that already and it worked fine, but now I want the home link hidden on every page, but not in the breadcrumb. So I can't set it to "exclude from nav".

In my previous projects I used this description, but I can't find it anymore online. (Maybe it's old??)
$bt = BlockType::getByHandle('autonav'); 
                        $bt->controller->displayPages = 'custom'; // top, above, below, second_level, third_level, custom (Specify the displayPagesCID below)
                        $bt->controller->displayPagesCID = '62'; // <-- Specify the CID of the page named: REPERTOIRE ( Gets the first level of pages under that section )
                        $bt->controller->orderBy = 'display_asc';  // display_asc, display_desc, chrono_asc, chrono_desc, alpha_desc 
                        $bt->controller->displaySubPages = 'relevant';  // none,  relevant, relevant_breadcrumb, all
                        $bt->controller->displaySubPageLevels = 'custom'; //custom, none
                        $bt->controller->displaySubPageLevelsNum = '0'; // Specify how deep level 
                        $bt->render('templates/sub_nav'); // Specify your template or type "view" to use default


I tried to use displayPagesCID to specify home and only show pages beneath. But it didn't work out.
Thanks for your help.

poetze
 
formigo replied on at Permalink Best Answer Reply
formigo
I'd probably do that with a CSS 'display:none' rule.

Autonav outputs a particular set of CSS classes on every <li/> and some specific ones for home i.e

nav-selected nav-path-selected nav-home nav-item-1


You can target using these to hide (or style) that link.

Hope that helps

Ollie
poetze replied on at Permalink Reply
poetze
Thanks, Ollie. That solved my problem