Changing page titles Changing page titles
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Changing page titles

Started by pcbill, May 12, 2007, 02:43:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pcbill

In the template.html the page title (for the browser) is built by the {TITLE} tag. I am looking to find where this is defined in hopes of changing the information that gets displayed.

As an example I would like to have the gallery description displayed on all pages after the gallery name. Adding it all to the gallery name in the configuration page will work but it screws up the graphics in the banner.

When an image is displayed the title & filename are displayed (ex: cat/2007_2780). I would like to keep the file name from being displayed.

Thanks,

Bill

Nibbler

Copy the pageheader() function from the sample theme into your custom theme.php and modify as you see fit. The {TITLE} tag is handled here

'{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)),

The filename is only displayed in the absence of a title, see displayimage.php


$picture_title = $CURRENT_PIC_DATA['title'] ? $CURRENT_PIC_DATA['title'] : strtr(preg_replace("/(.+)\..*?\Z/", "\\1", htmlspecialchars($CURRENT_PIC_DATA['filename'])), "_", " ");
...
pageheader($album_name . '/' . $picture_title, $meta_keywords, false);

pcbill

I am sure this is really basic :-[, I've added the pageheader() function to my theme and it works until I try and add the gallery description after the gallery name in the line:

'{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)),

I've tried it a many different ways and either get a parse error or it displays only the first letter of the gallery name then continues at the "-" as normal.

Thanks,

Bill

Nibbler

'{TITLE}' => $CONFIG['gallery_name'] . ' ' . $CONFIG['gallery_description'] . ' - ' . strip_tags(bb_decode($section)),

pcbill

Thanks I was not putting in the second $CONFIG

Bill