http://phpwiki.org/TemplatePlugin/Discussion
I've checked in a new plugin which is similar to CreatePage with the
template argument, but expands the vars on every page visit, not just
when creating the page.
This is almost the same as named parameters in mediawiki templates.
See http://meta.wikimedia.org/wiki/Help:Template
Sample TemplateFooter:
----
* Pagename: %%pagename%%
* Author: %%author%%
* Last modified time: %%mtime%%
Sample Usage:
<?plugin Template page=TemplateFooter?>
Problem: parameters delimiter
I wonder what the best syntax to pass the optional parameters to the
template should be.
The mediawiki syntax is horrible, but the point is
{{TemplateName|var1=value1|var2=value2}}
I have an optional syntax extensions (ENABLE_MARKUP_TEMPLATE = true)
which maps this syntax to our plugin invocation line:
<?plugin Template page=TemplateName vars="var1=value1&var2=value2"?>
This is consistent with the CreatePage vars="" syntax.
The problem is that with vars= you cannot easily pass vars over the url,
as in /wiki/?vars=var1=value1&var2=value2
The "&var2=value2" part will be ignored.
Bad syntax for manual overrides.
With the mediawiki delimiter "|" it will look like this:
/wiki/?vars=var1=value1|var2=value2&limit=20
Better syntax for manual overrides.
1. Should manual overrides within templates be allowed at all?
2. Should we change to | as variable pair delimiter in Template and
CreatePage?
3. Should we go away with "vars=" altogether and treat all unknown
Template plugin variables as proper Template variables?
=> <?plugin Template page=TemplateName var1=value1 var2=value2?>
--
Reini Urban
http://phpwiki.org/
|