[pmwiki-users] About {$:var} text-variables

Américo Albuquerque aalbuquerque at lanowar.sytes.net
Fri Sep 8 07:59:57 CDT 2006


I've been reading this thread and I'm a little confused of what you want 
We already have two cookbook recipes that allow to set variables, are 
you asking for a different way of setting variables?

On 9/6/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
 > On Wed, Sep 06, 2006 at 09:20:48AM +0200, Roman wrote:
 > > On 9/6/06, Kathryn Andersen wrote:
 > > > I *really* like the idea that the {$:var} stuff uses
 > > >
 > > >        Name: Patrick
 > > >        Version: 39
 > > >        State: Texas
 > >
 > > I like this simple syntax as well but some more explicit syntax would
 > > be also desirable. I think we can expect quite common request to use
 > > text variables definitions together with tables because of vertical
 > > alignment of values or because of better styling. I doubt that this
 > > simple syntax would work with tables, e.g.
 > >
 > > ||class=sometableclass
 > > ||Name:      ||Patrick ||
 > > ||Version:   ||39      ||
 > > ||State:     ||Texas   ||
with both the existing recipes we can do with the Page Variables 
Extensions recipe
(:set name=Patrick:)
(:set version=39:)
(:set state=Texas:)

or you can do with the Variables recipe
(:set name Patrick:)
(:set version 39:)
(:set state Texas:)

and later you can do whatever you like with those variables using the 
{$var} notation

 > Oooh, I like it.  But even if it's not a PmWiki default it will
 > be a customizable option.  Actually, individual sites will be
 > able to choose whatever syntax(es) they wish.
 > > One of J.Meiers's suggestions tries to solve this request. But there
 > > could be other ways, e.g. separate variable definition from its
 > > appearance. In this case, text variable definition should not appear
 > > in the HTML output:
 > >
 > > (:some variable definition beginning:)
 > > Name: Patrick
 > > Version: 39
 > > State: Texas
 > > (:some variable definition end:)
So you want to be able to set several variables in one step?

 > We already have the capability to define values that aren't 
displayed... :-)
 >     (:if false:)
 >     Name: Patrick
 >     Version: 39
 >     State: Texas
 >     (:ifend:)
 > Pm
Using the recipes above we define values that are not displayed. The 
problem using either recipe is the same, you can't set the variables 
inside a (:if:) and use it as a (:if:) clause at the same time without 
changing the core and even there you can't expect it to work like it 
would in a programming language

Americo Albuquerque

More information about the pmwiki-users mailing list