01294: Suggestion for pmwiki.tmpl

Summary: Suggestion for pmwiki.tmpl
Created: 2012-08-26 00:24
Status: Open
Category: Feature
From: simon
Priority: 45
Version: 2.2.42

Description: There have been some discussion around replacing the PmWiki skin.

In the interim I believe that there are some changes that could be made to improve the skin template.

The reasons include

  • CSS cascade ordering to allow included CSS to override generated CSS
  • orthogonal use of DefaultGroup
current proposed justification
<title>$WikiTitle | {$Group} / {$Title} $ActionTitle</title> <title>$WikiTitle | {$Groupspaced} / {$Titlespaced} $ActionTitle</title> Use Groupspaced and Titlespaced
<link rel='stylesheet' href='$SkinDirUrl/pmwiki.css' type='text/css' /> move to after <!--HTMLHeader-->
<!--HTMLHeader--> <!--HTMLHeader--> no change
<link rel='stylesheet' href='$SkinDirUrl/pmwiki.css' type='text/css' /> Moved from before <!--HTMLHeader--> to make pmwiki.css styles override through the CSS cascade any internal generated CSS
<div id='wikilogo'><a href='{$ScriptUrl}'><img src='$PageLogoUrl'
    alt='$WikiTitle' border='0' /></a></div>
<div id='wikilogo'><a rel='nofollow' href='{$ScriptUrl}'><img src='$PageLogoUrl'
    alt='$WikiTitle' border='0' /></a></div>
add rel='nofollow'
<span class='headnav'><a href='{$ScriptUrl}/$[{$Group}/RecentChanges]'
      accesskey='c'>Recent Changes</a> -</span>
<span class='headnav'><a rel='nofollow' href='{$ScriptUrl}/$[{$Group}/RecentChanges]'
      accesskey='c'>Recent Changes</a> -</span>
add rel='nofollow'
<a href='{$ScriptUrl}/$[{$SiteGroup}/Search]'>$[Search]</a>: <a rel='nofollow' href='{$ScriptUrl}/$[{$SiteGroup}/Search]'>$[Search]</a>: add rel='nofollow'
<!--wiki:PITS.SideBar Site.SideBar--></td> <!--wiki:{$Group}.SideBar {$DefaultGroup}.SideBar {$SiteGroup}.SideBar--></td> add {$DefaultGroup}.SideBar
<div id='wikicmds'><!--wiki:{$Group}.PageActions {$SiteGroup}.PageActions--></div> <div id='wikicmds'><!--wiki:{$Group}.PageActions {$DefaultGroup}.PageActions {$SiteGroup}.PageActions--></div> add {$DefaultGroup}.PageActions
<!--/PageActionFmt--> insert ending tag
<h1 class='pagetitle'>{$Title}</h1></div> <h1 class='pagetitle'>{$Titlespaced}</h1></div> use {$Titlespaced}
<div class='footnav'>
  <a rel="nofollow" href='{$PageUrl}?action=edit'>$[Edit]</a> -
<a rel="nofollow" href='{$PageUrl}?action=diff'>$[History]</a> -
  <a rel="nofollow" href='{$PageUrl}?action=print' target='_blank'>$[Print]</a> -
  <a href='{$ScriptUrl}/$[{$Group}/RecentChanges]'>$[Recent Changes]</a> -
  <a href='{$ScriptUrl}/$[{$SiteGroup}/Search]'>$[Search]</a></div>

<div class='lastmod'>$[Page last modified on {$LastModified}]</div></div>

<!--wiki: PmWiki.Footer PITS.Footer Site.Footer-->
add Cookbook:WikiFooter to the core

IMHO, PmWiki really deserves an improved (while kept simple) skin. --Dfaure August 26, 2012, at 04:51 AM

I would "+1" what Petko Yotov has written on the pmwiki-users discussion list about the default skin's cascade order. The existing order is deliberate and should remain the way it is. Here's what he wrote:

Keep in mind that such a change in the "default" skin will have consequences not only on new wikis, but also on any wiki which is upgraded and has some recipes. Which may change the appearance of the site without the user having asked for anything.

If we don't have a way to enable this kind of disruptive changes only on new wikis, even if the pros are more than the cons, we shouldn't force them.

In the case of pmwiki.css before the HTMLHeader, there is one feature that wasn't mentioned, the local files pub/css/local.css, pub/css/Group.css and pub/css/Group.Page.css that are loaded after the css file of the skin. Having it after pmwiki.css (or anyskin.css) allows a wiki to adapt the appearance of the skin more easily.

The current order seems to me very good, even if we didn't have existing wikis that would break when we change it. The current order is:

 - pmwiki.css (or anyskin.css, if the skin author respected the order)
 - $HTMLStylesFmt from the core and from recipes, in a <style> block
 - from pub/css/ : local.css, Group.css and Group.Page.css in that order if they exist

So, we are unlikely to change that order for the default skin. Skin authors may select a different way if they have reasons for it.

Proposed changes to the default skin need to be carefully considered because they may break existing wikis unexpectedly. For example, suddenly switching to Groupspaced and Titlespaced would impart not-so-subtle changes to a wiki's pages after an upgrade.

--Hagan Fox

See also

  • 00615   Suggested default template changes
  • 01220   Group homepages not resolved correctly when group only supplied