Forum
List / Detail Page - Page Title
How do I change the <title> for List/Detail pages?
For example when someone lands on the page listing the title is just <title>Our Work</title> however when someone clicks on an item into the listing to show the 'detail' I want to change to <title>Our Work - [place] - [town]</title> where place and town are perch:content fields in the detail template
The <title></title> tag is in a layout 'global.header' and currently uses <?php perch_pages_title(); ?>
I want to be able to maintain <?php perch_pages_title(); ?> for the other pages on the website.
Personally, I always do this:
In the list/detail page, I have something like:
Then, in my header.php, I have:
I would definitely be interested to know if there's a better way, though.
EDIT: In case it isn't obvious, this is assuming you're getting the list/detail with a URL like mypage.php?myslug=slug
Thanks Shane,
However, the title is part of the layout global.header currently set as
So do I have to create a separate header layout for the list/detail page?
I think you want this