[pmwiki-users] Re: Re: Re: Re: Some documentation added for "markup variables" (Was: How to add a variable to {$var}-markup?)
chr at home.se
chr at home.se
Tue Jul 5 16:48:50 CDT 2005
On Tue, 5 Jul 2005, Patrick R. Michaud wrote:
> Well, not exactly. The example says "name of current group using
> only lowercase letters", but doesn't give that. You really want
>
> $GLOBALS['mygroup'] = lower(FmtPageName('$Group', $pagename));
Ok, I've fixed it now. I also made slight changes to text.
http://www.pmwiki.org/wiki/PmWiki/MarkupVariables
> Of course, one doesn't need to use $GLOBALS at all for this --
> for this particular example it seems just as easy to do:
The only reasons I could think of where:
* You get to define several "markup variables" using a single rule
* The variables are added to $GLOBALS, and thus available in FmtPageName()
etc. (Not that I know why that'd be useful).
Btw, if you look at the top of the page
http://www.pmwiki.org/wiki/PmWiki/MarkupVariables
you'll see that I left a red note wondering what you need to do in order
to make the "markup variables" available in the php code. The reason for
this question is really that I linked to this page from PmWiki.Variables,
where the PmWiki.Variables mostly discusses php-variables instead of
markup variables.
So for instance, given that "{$Groupspaced}" works in the markup, what
does it take to be able to use it like this:
$var = "Hello, the current group is $Groupspaced";
I'm guessing you'd have to do something like:
$Groupspaced = FmtPageName("$Groupspaced", $pagename);
/Christian
--
Christian Ridderström, +46-8-768 39 44 http://www.md.kth.se/~chr
More information about the pmwiki-users
mailing list