[Moin-user] Defining custom variables

Greg Ward gerg.ward+moin at gmail.com
Mon Oct 20 13:20:11 EDT 2008


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?

Thanks --

        Greg




More information about the Moin-user mailing list