Dynamic Page Titles

General project discussion. NOT for help questions.
Post Reply
tripp
Forum Members
Forum Members
Posts: 10
Joined: Thu Dec 03, 2009 11:23 pm

Dynamic Page Titles

Post by tripp »

Hi Everybody,

I'm trying to figure out how to dynamically change the title of my page from inside a custom module that I've written. Is there anyway from within a module "action" file that I can specify the title of the page? I can't find any info on this here, but I'm sure that someone else has had this issue. Any ideas?

Cheers,

Tripp
Peciura

Re: Dynamic Page Titles

Post by Peciura »

In your php code add

Code: Select all

global $gCms;
$smarty = $gCms->GetSmarty();
$smarty->assign('title_temp', "$custom_title_you_prefer");
In page template replace tag "{title}" with

Code: Select all

{if !empty($title_temp)}
   {$title_temp}
   {assign var='title_temp' value=''}{*optional line*}
{else}
   {title}
{/if}
tripp
Forum Members
Forum Members
Posts: 10
Joined: Thu Dec 03, 2009 11:23 pm

Re: Dynamic Page Titles

Post by tripp »

Thanks mate, just what I needed. My apologies to the moderators for putting this in the wrong forum. No real excuse for that, I just wasn't paying attention.

Cheers,

Tripp
Post Reply

Return to “General Discussion”