[pmwiki-users] Checking if a {$$var} is set

noskule noskule at gmx.net
Wed Feb 4 07:27:48 CST 2009


DaveG schrieb:
> 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...
>
> _______________________________________________
>   

I did run into the same problem, I guess this problem could be solved if 
not defined special variables ( {$$xx} ) would be replaced with nothing, 
anyone know how to do this?

grz nos



More information about the pmwiki-users mailing list