[pmwiki-users] Skin changes, 2.1.16 released

Patrick R. Michaud pmichaud at pobox.com
Sat Aug 26 16:00:49 CDT 2006


I've just released version 2.1.16, which makes a number of improvements
to the skin-handling code in PmWiki.  As usual, the new release
is available from 

    http://www.pmwiki.org/pub/pmwiki/pmwiki-2.1.16.tgz
    http://www.pmwiki.org/pub/pmwiki/pmwiki-2.1.16.zip
    http://www.sourceforge.net/projects/pmwiki
    svn://pmwiki.org/pmwiki/tags/latest

Several discussion threads on PmWiki-users have led to the
changes in this release.  Although the changes are somewhat
significant, they primarily affect future skin creators or
people wanting to change the way skins are managed in PmWiki.
Existing 2.1.x sites should be able to upgrade to this latest
release without any negative impacts.

Also, if the things written below don't make any sense to you,
it's safe to ignore them.  :-)


$HTMLFooterFmt
==============

The thread starting at 
http://host.pmichaud.com/pipermail/pmwiki-users/2006-August/030968.html
discusses the potential of having an $HTMLFooterFmt variable
that allows recipes to add things near the end of HTML output
(similar to how $HTMLHeaderFmt allows things to be added 
in the <head> section of the HTML output).  I wasn't sure if
this feature would be useful (PmWikiPhilosophy #3), but then
earlier today I realized that quite a lot of the debugging things
I often do would be greatly simplified if $HTMLFooterFmt were
available.  So, it's officially adopted into the core.

However, the proposed <!--FooterText--> directive (corresponding
to <!--HeaderText-->) causes me some concern, especially since
it will generally appear directly below the <!--PageFooterFmt--> 
directive.  That seems to me to invite confusion.  Thus I've
instead chosen <!--HTMLFooter--> as the directive that
indicates where the contents of $HTMLFooterFmt should be
placed in the output.  Typically a skin template will place
<!--HTMLFooter--> just before the </body> tag of the template,
and this is what the PmWiki-distributed skins now do.

Of course, this means that <!--HeaderText--> really ought to
be named <!--HTMLHeader-->, since it outputs the contents of
$HTMLHeaderFmt, so this release also adds <!--HTMLHeader-->
to be used as a replacement for <!--HeaderText-->.  Existing
skin designers shouldn't panic, however, <!--HeaderText-->
will continue to work for a long time to come.


$SkinLibDirs
============

The thread starting at
http://host.pmichaud.com/pipermail/pmwiki-users/2006-August/031154.html
talks about fixing difficulties in relocating wikifarm directories
outside of a webserver's document root.  This has also been noted
by Hagan Fox and others in PITS #00708.  The solution seems to be
to introduce a new $SkinLibDirs variable, which tells PmWiki
where to look for skins and the corresponding url to use for each.

The default setting of $SkinLibDirs is

    array("./pub/skins/\$Skin"      => "$PubDirUrl/skins/\$Skin",
          "$FarmD/pub/skins/\$Skin" => "$FarmPubDirUrl/skins/\$Skin")

The values on the left identify the filesystem directories to
search for skins, while the values on the right specify the
corresponding url to use if the skin is found in that directory.

For example, a site that wanted to have skins come from
only one directory could set

   $SkinLibDirs = array(
        "/var/www/html/farmpub/skins/\$Skin" 
          => "/farmpub/skins/\$Skin");

This tells pmwiki to look in the /var/www/html/farmpub/skins/<skinname>
directory for any skins, and if found to use the url 
"/farmpub/skins/<skinname>" as the url to the skin's directory.


Comments and questions welcomed as always.

Thanks,

Pm




More information about the pmwiki-users mailing list