[pmwiki-users] A standard way to set the html-header "title"

Stirling Westrup sti at pooq.com
Fri Nov 24 15:11:23 CST 2006


Hans wrote:
> Thursday, November 23, 2006, 9:30:02 PM, Stirling wrote:
> 
>> I agree completely, I modified my copy of the Triad skin so that it just had
> 
>>   $WikiTitleFmt
> 
>> instead of the default <title>...</title> in the skin and put this into the
>> skin.php:
> 
>>   $FmtPV['$WikiTitle'] = '$GLOBALS["WikiTitle"]';
>>   $FmtPV['$WikiTitleFmt'] = '$GLOBALS["WikiTitleFmt"]';
> 
>>   SDV($WikiTitleFmt,"<title>\$WikiTitle - \$Group - \$Title</title>");
> 
>> That way each time I use this skin, I can change what format a title has.
> 
> I think this is a good idea, and will incorporate it in the next skin
> updates (FixFlow, Gemini, Triad), but modified as shown below.
> I would rather call it $HTMLTitleFmt, in line with the
> HTMLHeader. And there is no need to remove the <title> ... </title>
> tags from the skin template, since they are in any way necessary for a
> HTML document. Also I don't see the need to make HTMLTitleFmt available
> as a page variable.

True. This change was one of my first attempts at modifying PmWiki and skins,
so I didn't choose the best method.

> Note that if you wish to define $HTMLTitleFmt in config.php,
> you would need to retrieve values for $Group  and $Title first,
> since they change from page to page.

Not necessary, as variable names inside of skin replacements get expanded
automatically. Thus, the following works inside config.php (note the single
quotes):

 $HTMLTitleFmt = '$WikiTitle: $Group - $Name';





More information about the pmwiki-users mailing list