Forum

Thread tagged as: Question, Configuration

Breadcrumb not displaying default document 'Home' with option 'hide-default-doc'...

Hi,

I'm trying to insert a basic breadcrumb that always displays the Default document which in this case is index.php named as 'Home'. 'Home' is set to be hidden in the main navigation but I have set an option within the breadcrumb to display all hidden pages as I am using navigation groups to create sub-nav in the header.

<?php perch_pages_breadcrumbs(array(
        'hide-default-doc' => false,
        'include-hidden'=> true,
    ));
?> 

And using the default breadcrumbs template:

<perch:before>
<ul class="breadcrumbs">
</perch:before>
    <li>
        <perch:if exists="perch_item_last">
            <perch:pages id="pageNavText" />
        <perch:else />
            <a class="primary" href="<perch:pages id="pagePath" />"><perch:pages id="pageNavText" /></a> &gt;
        </perch:if>
    </li>
<perch:after>
</ul>
</perch:after>

However it is not displaying on any of the pages apart from the Homepage. Is this how this option is supposed to work by always outputting the 'Home' link on every page?

My Diagnostic report says:

PERCH_DEFAULT_DOC: index.php

When I visit another top level page I want the Breadcrumb to display 'Home > Top level page'. It is currently just displaying 'Top level page' despite the 'hide-default-doc' set to false.

Studio Daughter

Studio Daughter 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

If it's always in the breadcrumb, why not add it to the template? That would be simpler and faster to render.

That's what I've ended up doing. It would be helpful for future reference to know if the option 'hide-default-doc' => false should be working in this way though :)

Drew McLellan

Drew McLellan 2638 points
Perch Support

hide-default-doc should trim the value of PERCH_DEFAULT_DOC from the end of the URL when outputting the link. That shouldn't ever result in nothing, unless the path somehow doesn't begin with a /.