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

Patrick R. Michaud pmichaud at pobox.com
Fri Nov 24 16:13:00 CST 2006


On Fri, Nov 24, 2006 at 04:11:23PM -0500, Stirling Westrup wrote:
> Hans 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.

I agree with all of Hans' comments -- there's no need to make it
a page variable (WikiWord globals are automatically handled in templates).

> > 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. 

That's correct, and basically true for any variable ending in $...Fmt
(page variables are automatically expanded in $...Fmt variables, including
skin templates).

Thus, I vote that skin templates basically use $HTMLTitleFmt for
the title, and if the title is not set by a local config or skin
then PmWiki will default it to

    $HTMLTitleFmt = '$WikiTitle | {$Group} / {$Title} $ActionTitle';

Pm




More information about the pmwiki-users mailing list