Forum

Thread tagged as: Meta, Blog, Gallery

Page Titles Coding List

I thought I would share this with fellow Perchers.

It's basically my list of how to show different "Page Titles". I am not a PHP guru so I have a little text file to copy and paste from, so thought I would share this on here also.

Please feel free to add or make suggestions:

This is assuming you're using Perch Layouts and have a layout template called "headerCode"

Normal content page:

<?php perch_layout('global.headCode’, array(
'title'    => perch_page_title(true),
)); ?> 

Blog 'index.php'

<?php perch_layout('global.headCode’, array(
'title' => perch_page_title(true) . (perch_get('page') ? ' Page '.perch_get('page') : ''),
)); ?> 

Blog 'archive.php'

<?php perch_layout('global.headCode', array(
'title' => 'Archived News for ' . perch_blog_category(perch_get('cat'), true) . perch_get('year'),
));?>

Blog 'post.php'

<?php perch_layout('global.headCode', array(
'title' => perch_blog_post_field(perch_get('s'), 'postTitle', true),
));?>

Gallery 'album.php'

<?php perch_layout('global.headCode', array(
    'title'    => perch_gallery_album_field(perch_get('s'), 'albumTitle', true),
)); 
?>

Shop 'category.php'

<?php perch_layout('global.headCode', array(
    'title'    => perch_shop_category(perch_get('cat'), true)
)); 
?>

Shop 'product.php'

<?php perch_layout('global.headCode', array(
    'title'    => perch_shop_product_field(perch_get('s'), 'productTitle', true),
)); 
?>
James Tedder

James Tedder 0 points

  • 7 years ago