[Moin-user] Defining custom variables
rb.proj at gmail.com
Wed Oct 22 03:10:42 EDT 2008
Greg Ward schrieb:
> I'm having problems defining custom variables on a page following the
> instructions in HelpOnVariables. I think there is definitely a doc bug
> in there; that page is not very clear on what is possible, never mind
> how to do it.
> First: from the wording in HelpOnVariables, it's not even clear that I
> *can* define custom variables. The section header "Expanding Variables"
> is ambiguous: to most programmers, "expanding" a variable means, for
> example, replacing "@USERNAME@" with "gward". But it's also possible
> for it to mean "expand the set of variables by defining new ones". That
> is kind of what it sounds like. If so, I would suggest rewriting this
> section as:
> == Defining New Variables ==
> You can add your own custom variables to any page. Just create a new sub-page called `MyDict` and enter a dictionary of custom variables there (see HelpOnDictionaries). For example, to add variables `REVIEWER` and `REVIEW_DATE` to `MyPage`, create `MyPage/MyDict` and give it content like
> REVIEWER:: JohnDoe
> REVIEW_DATE:: 2008-10-20
> Is that correct?
> Second: if that *is* correct, it doesn't seem to work in 1.8.0rc1. At
> any rate, I have created a "/MyDict" subpage and am unable to access
> those variable values using <<GetVal()>>. Is there a working example of
> this feature somewhere?
the page MyDict has to be created as a subpage of your homepage
I have there on my ReimarBauer/MyDict some vars for me defined and I can
for example write @IMG@ on a page and this is expanded to my image.
is also expanded to the value of the key.
More information about the Moin-user