[Pmwiki-users] Major change to layout code likely (again!)

Patrick R. Michaud pmichaud
Sun Feb 22 01:18:38 CST 2004


Okay, the critics have spoken and the layout system introduced in 0.6.0
is being officially declared "too ugly to keep", at least as the default.
As a result, based on excellent feedback from others I've developed a 
new template-based system for describing layouts and this system is
now in use at the main PmWiki site (http://www.pmichaud.com/pmwiki).
My intent at this point is to release 0.6.1 with the new layout system
as the default, and relegate the short-lived 0.6.0 to the cookbook or
an external module somewhere.  If anyone strongly disagrees--now's
the time to say something.

For those who may have spent a lot of time converting to 0.6.0 and 
the layout scheme it introduced:  1) my sincere apologies for 
abandoning it so quickly, 2) you'll find it's very easy to convert
to the new system, and I'm very willing to help with conversions, and
3) if you really loved the scheme used in 0.6.0 it will still be
available to you as a plug-in.

The details of the template system are below, but it definitely pays
to take a quick look at some of the examples at 
http://www.pmichaud.com/pmwiki/pub/skins.  (IE users may get an odd 
looking page when viewing some of the template files because IE
mistakenly believes it's HTML source--if so then just choose "View 
Source" to see the actual template file text.)

Essentially, each layout is primarily controlled by a single file 
containing HTML elements, variable substitutions (indicated by '$'), and 
HTML comments.  The most common substitutions are
   $ScriptUrl - the URL of the script (e.g., http://.../pmwiki/pmwiki.php)
   $PageUrl - the URL of the current page
   $Group - the name of the current group
   $Title - the title of the current page
   $HTMLHeaders - other dynamic HTML <head> elements

The HTML comment <!--PageText--> indicates the point at which the main
page content should be inserted into the HTML.

The HTML comments <!--PageHeaderFmt-->, <!--PageFooterFmt-->, and
<!--PageTitleFmt--> delimit the boundaries of the page's header, footer,
and title and allow a WikiAuthor to suppress these sections using the 
[[noheader]], [[nofooter]], and [[notitle]] markups.  If the template
doesn't include these section identifiers, then the [[noheader]] etc.
markups will have no effect.  (Eventually there will probably be a 
directive to control the sidebars.)

Finally, an HTML comment such as <!--wiki:Group.PageName--> will
cause PmWiki to generate the contents of Group.PageName at that point
in the output.  Variable substitutions can be performed here and
multiple files may be listed, so that markup such as 
<!--wiki:$Group.SideBar Main.SideBar--> will display the contents
of the SideBar page in the current group if it exists, otherwise it
will display Main.SideBar if it exists.  Similarly, one can include 
another file from the local filesystem by using 
<!--file:path/to/filename-->, or make a call to a PHP function via
<!--function:MyFunction arg-->.

There's no more having to guess where a needed CSS file should be
located based on variable names or directories to be searched...instead 
you specify any CSS files, images, or other items you want to use 
directly in the template file.  Furthermore, the complete layout
specification--template, CSS, images--can safely reside in a single
public directory.

So, please get your comments, suggestions, feedback, and approval/
disapproval to me right away.  The longer the complex code remains
"out there", the more new and existing users that will be unnecessarily
subjected to it, thus I'd like to get the new release out within the
next 24 hours.

Pm



More information about the pmwiki-users mailing list