[pmwiki-users] Checking if a {$$var} is set
DaveG
pmwiki at solidgone.com
Tue Feb 3 19:58:38 CST 2009
Peter Bowers wrote:
> Is this a theoretical markup that you are using? I've never seen
> anything like the val=myval or the VAL_IS_SET operator or the $$val
> syntax...
>
> If I'm confused maybe others are as well? Or maybe I'm just being slow
> today... :-)
Guess I was even more confused than you then. Even my subject header was
wrong.
Here's what I meant to say.
Is there a way to determine whether a variable passed into an included
page has a value, and whether the variable has actually been passed in?
Doing something like:
(:include mygroup.mypage var="myval" :)
and then inside mygroup.mypage:
(:if !equal {$$var} "" :)
The above works, except when {$$var} is not actually passed into the
included page, as:
(:include mygroup.mypage var="myval" :)
in which case {$$var} evaluates to the string "{$$var}" (ie, no
substitution, as there is nothing to substitute).
I can use a Markup Expression to do a test, but wondered if there was a
'built-in' way.
~ ~ Dave
PS: Hopefully that makes a little more sense...
More information about the pmwiki-users
mailing list