[Pmwiki-users] Skins

Patrick R. Michaud pmichaud
Sat Feb 21 19:04:39 CST 2004


On Sun, Feb 22, 2004 at 05:42:29AM -0800, Steven Leite wrote:
> - - - - - - - - - -
> MY DREAM TEMPLATE (under construction)
> - - - - - - - - - -

Below is my conception of what the PmWiki default template would
look like if we followed something along the lines of what Steven
has suggested.  Some general comments about the format of the template
file:

 - "$VarName" in the template causes the value of $VarName to be substituted at
   that point.  This might cause problems if someone really wants to display
   a dollar sign in the HTML output, although one can always use "$" 
   for that.
 - "$[some string]" is an internationalized string.  Thus "$[Edit page]"
   is substituted with the translation of "Edit page" if one exists.
 - <!--PageHeaderFmt-->, <!--PageFooterFmt-->, etc. delimit the traditional
   header, title, and footer sections.  If they don't exist in the file,
   directives such as [[noheader]], [[notitle]], etc. won't have any effect.
 - <!--PageContents--> denotes the point at which the actual page
   contents are to be displayed, whether it's the contents of the page,
   an edit form, search results, etc.
 - <!--wiki:Foo.PageName--> substitutes the contents of Foo.PageName
   at that point.  The page name can be parameterized as well, 
   thus <!--wiki:$Group.PageName--> substitutes PageName from the 
   current group.
 - <!--file:filename.php--> includes the contents of filename.php

Let me know if you think this is an easier way to specify layouts.  Note
that since the template file is NOT a .php file, it can easily go
in the pub/skins directory instead of local/, along with any associated
css and graphics files.

A potential problem with this layout:  It's hard for Cookbook
scripts to manipulate the output, e.g., items in the <head>...</head>
block.  Note that there's no provision for group or page-specific
CSS files here, but perhaps that can be added with an appropriate
directive (I need suggestions).
  
Pm
-------------- next part --------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
    "http://www.w3.org/TR/html40/loose.dtd">
<html><head>
  <link rel='stylesheet' href='$PubDir/css/stdlayout.css' type='text/css' />
  <link rel='stylesheet' href='$PubDir/skins/pmwiki.css' type='text/css' />
  <link rel='stylesheet' href='$PubDir/css/local.css' type='text/css' />
  <meta name='robots' content='$MetaRobots' />
  <title>$WikiTitle - $PageName</title>
</head>
<body>
<!--PageHeaderFmt-->
  <div id='wikilogo'><a href='/wiki/PmWiki/PmWiki'><img 
    src='/pmwiki/pub/pmwiki-32.gif' border='0' alt='PmWiki' /></a></div>
  <div id='wikihead'>
  <form action='$[Main/SearchWiki]'>
    <input type='hidden' name='pagename' value='$[Main/SearchWiki]' />
    <a href='$ScriptUrl/$[Main/SearchWiki]'>$[SearchWiki]</a>:
    <input class='searchbox' type='text' name='text' value='' />
    <input class='searchbutton' type='submit' value='$[Go]' /></form></div>
<!--PageLeftFmt-->
  <table id='wikimid' width='100%' cellspacing='0' cellpadding='0'>
    <tr><td id='wikileft'>
        <!--wiki:$Group.SideBar $DefaultGroup.SideBar--></td>
      <td id='wikibody'>
<!--PageTitleFmt-->
       <div id='wikicmds'>
         <a href='$ScriptUrl/$[$Group/RecentChanges]'>$[Recent Changes]</a>
         <a href='$PageUrl?action=print' target='_blank'>$[Printable View]</a>
         <a href='$PageUrl?action=diff'>$[Page History]</a>
         <a href='$PageUrl?action=edit'>$[Edit Page]</a></div>
       <div id='wikititle'>
         <div class='pagegroup'><a href='$ScriptUrl/$Group'>PmWiki</a> /</div>
         <div class='pagetitle'><a href='$PageUrl'>$Title</a></div></div>
<!--PageContents-->
<!--PageRightFmt-->
       </td></tr></table>
<!--PageFooterFmt-->
  <div class='wikifoot'>
    <div class='footnav'>
      <a href='$PageUrl?action=edit'>$[Edit Page]</a> -
      <a href='$PageUrl?action=diff'>$[Page History]</a> -
      <a href='$PageUrl?action=print' target='_blank'>$[Printable View]</a> -
      <a href='$ScriptUrl/$[$Group/RecentChanges]'>$[Recent Changes]</a> -
      <a href='$ScriptUrl/$[PmWiki/WikiHelp]'>$[WikiHelp]</a> -
      <a href='$ScriptUrl/$[Main/SearchWiki]'>$[SearchWiki]</a></div>
    <div class='lastmod'>$[Page last modified on $LastModified]</div></div>
</body>
</html>


More information about the pmwiki-users mailing list