Forum

Thread tagged as: Question, Problem

List Detail page title

Hi

I'm using list and detail pages and I'm wanting to pull the name of each detail page into the page title.

I have currently been using this code in the page template for list detail pages.

<title><?php perch_pages_title(); ?> 
<?php
    $result = perch_content_custom('Products', array(
'skip-template'=>true
));

echo $result[0]['title'];
?></title>

The problem is that it is only taking the title from the first detail page in the list so when I'm on another detail page it will always show the title of the first detail page, I need it to show the name of whatever detail page you're on.

Also when I'm on the list page I only want to show the page title but it is also showing the first detail page title.

Thanks

Peter Meenagh

Peter Meenagh 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You need to use the same filter as you do when displaying the main item.

Great thanks for that works perfectly now.