[pmwiki-users] The Template Shuffle
David Spitzley
dspitzle at wash.k12.mi.us
Fri Apr 15 12:34:19 CDT 2005
Huzzah! Off to the Cookbook it goes!
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'] = '&template=$1')");
Pm
More information about the pmwiki-users
mailing list