Categories > TinyButStrong general >

Changing page HTML title

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Phil Lee
Date: 2007-09-13
Time: 23:51

Changing page HTML title

Hello.  I'm using TBS as part of the phpMotion video sharing application (http://www.phpmotion.com).

At the moment the page title is the same for each page but I'd like it to be different for each page.  For example for index.php I'd like it to be a generic title but for the play.php page I'd like it to be the title of the video that the user is watching.

I've tried the following but it doesn't seem to work.

<title>
[var..script_name;if [val]='index.php';then 'Generic title']
[var..script_name;if [val]='play.php';then 'Video title']
</title>

However, if this does is display the script name in the title tag but I've used the same syntax as the example.

What am I doing wrong ?

Phil
By: Skrol29
Date: 2007-09-14
Time: 00:34

Re: Changing page HTML title

Hi Phil,

At first, try the tag [var..script_name] just to check if the value is what you expect (index.php, play.php,...)

Then, you can use one tag with several parameters if/then. This is supported by TBS 3.2.0.
Example:
[var..script_name;if [val]='play.php';then 'Video title';if [val]='sound.php';then 'Sound';else 'Generic title']
By: Phil Lee
Date: 2007-09-14
Time: 13:54

Re: Changing page HTML title

Thank you that worked perfectly.  I have no idea why my version didn't work though !