[pmwiki-users] The Template Shuffle

David Spitzley dspitzle at wash.k12.mi.us
Fri Apr 15 12:42:41 CDT 2005


I'm drafting the Cookbook entry for this, and I just wanted to check: 
how would you unset the template for a page with this directive (if at
all)?  I tried all of the following:

(:template:)
(:template "":)
(:template :) (one space after template)
(:template  :) (two spaces after template)

and none of them appear to work.


David

>>> "Patrick R. Michaud" <pmichaud at pobox.com> 04/15/05 1:26 PM >>>
On Fri, Apr 15, 2005 at 01:08:05PM -0400, David Spitzley wrote:
> Oops, sent this directly to PM:
> 
> Hmm, now it doesn't even work for the first directive on the page. 
I
> even tried tweaking the code from "PZZ(\$GLOBALS['FmtV'] to
['$FmtV'],
> and it doesn't make a difference.

Oops, I forgot a backslash.  This one definitely works, as I've
tested it at http://www.pmwiki.org/wiki/Test/Template .  :-)

# change the link format for creating new pages
$LinkPageCreateFmt = "<a class='createlinktext'
href='\$PageUrl?action=edit\$LinkTemplate'>\$LinkText</a><a
class='createlink' href='\$PageUrl?action=edit\$Link
Template'>?</a>";

# default is no template
$FmtV['$LinkTemplate'] = '';

# the (:template Group.PageName:) markup causes any create page
# links that follow to use Group.PageName as the template
Markup('template', 'directives',
  '/\\(:template\\s+(\\S+)\\s*:\\)/e',
  "PZZ(\$GLOBALS['FmtV']['\$LinkTemplate'] = '&amp;template=$1')");

Pm




More information about the pmwiki-users mailing list