Forum

Thread tagged as: Question, Problem

Breadcrumbs not appearing on Detail Page

Hi,

I am having trouble with my breadcrumbs displaying on my detail page from my list/detail page setup. Breadcrumbs show up correctly on my list page, but the breadcrumb php doesn't output anything on the detail page.

I'm using Perch 2.4.9 at the moment. Other web applications in use have hindered upgrading but we are working on upgrading our system.

You can see the [list page here] (https://pdev.nanfa.org/native-fish/fish-in-focus.php)

[Detail page is here] (https://pdev.nanfa.org/native-fish/article.php?s=christmas-darter)

This is the code for the header of the page

<html>

<head>
    <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />

    <title></title>

    <link rel='stylesheet' type='text/css' href='/style.css' />

</head>

<body>

<div class="header">        
    <div class="navbar">
        <div class="menu">  
            <div class="menu-content centered"> 
            <div class="logo"><img src="/images/logo.png" width="100%"/></div>      
            <?php perch_pages_navigation(array(
                'levels' => 2,
            )); ?>
            </div>
        </div>
    </div> <!-- /navbar -->

    <div class="slider">
        <div class="slideshader">
            <div id="htmlcaption" class="nivo-html-caption"><h2>This is a caption</h2><p>This is a tag line</p></div>
        </div>
        <div id="slider">
            <img src="/images/watchNew-crop3.jpg" width="100%" />
        </div>
    </div><!-- /slider -->
</div><!-- /header -->
<div class="headerbar">
    <div class="content centered">
        <?php perch_pages_breadcrumbs(); ?>
    </div>
</div>  

Code to the detail page - page in question is using perch_content_custom('FishInFocus'


<?php include($_SERVER['DOCUMENT_ROOT'].'/perch/runtime.php'); ?> <?php perch_layout('header'); ?> <div class="section tan"> <!-- section tan --> <div class="content centered white"><!-- content --> <article class="centered"> <?php perch_content_custom('FishInFocus', array( 'page' => '/native-fish/fish-in-focus.php', 'template' => 'article.html', 'filter' => 'slug', 'match' => 'eq', 'value' => perch_get('s'), 'count' => 1, )); ?> <?php perch_content_custom('BoardMembers', array( 'page' => '/about-nanfa/board-of-directors.php', 'template' => 'page-bod.html', 'filter' => 'slug', 'match' => 'eq', 'value' => perch_get('s'), 'count' => 1, )); ?> <?php perch_content_custom('MemberServices', array( 'page' => '/about-nanfa/board-of-directors.php', 'template' => 'page-bod.html', 'filter' => 'slug', 'match' => 'eq', 'value' => perch_get('s'), 'count' => 1, )); ?> <?php perch_content_custom('Articles', array( 'page' => '/study-learn/articles.php', 'template' => 'page-article.html', 'filter' => 'slug', 'match' => 'eq', 'value' => perch_get('s'), 'count' => 1, )); ?> <?php perch_content_custom('Captive Care', array( 'page' => '/native-fish/articles.php', 'template' => 'page-article.html', 'filter' => 'slug', 'match' => 'eq', 'value' => perch_get('s'), 'count' => 1, )); ?> </article> </div><!-- /content --> </div><!-- /section tan --> <?php perch_layout('footer'); ?>

Template code for detail page


<h1><perch:content id="title" type="text" label="Common Name" required="true" title="true" /> - <i><perch:content id="scientific" type="text" label="Scientific Name" /></i></h1> <img src="<perch:content id="featuredimage" type="image" label="Featured Image" />" width="100%"/> <perch:content id="content" type="textarea" label="Content" textile="true" editor="markitup" /> <div class="author-block "> <div class="col-2-3 valign"> <img src="<perch:content id="image" type="image" label="Author Image" />" class="left" /><h3 class="name"><perch:content id="author" type="text" label="Author Name" /></h3> <p><perch:content id="bio" type="text" label="Author Bio" /></p></div> <div class="col-1-3 valign"> <h3>Got Questions?</h3> <p>Message him on the forum</p> </div> </div> <perch:content id="slug" for="title" type="slug" suppress="true" /> <perch:content id="thumbnail" type="image" label="Thumbnail" width="100" height="100" crop="true" suppress="true" /> <perch:content id="intro" type="textarea" label="Intro" editor="markitup" suppress="true"/>

The breadcrumbs aren't showing up for just that list / detail section but for all my list / detail pages which all use a similar setup. If I can get this working on one page I think I can get it working on the rest.

Andrew Kennedy

Andrew Kennedy 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

The breadcrumbs are showing navigation - i.e. the page structure - so they don't know about the items you're displaying in your detail view.

To have the detail item added to the breadcrumbs you'll need to pass it into the breadcrumb template yourself. It's not a real page.