Quantcast

Use value of variable in template

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Use value of variable in template

Marcel Be
Hello all,

I'm stuck right now at what I remeber to be a simple thing.
In a Form variables of a certain group get a value and can be flagged as used or not used with a checkbox, which allows to deselect the whole content-group by just not checking the box. That's the idea so far.

In the form I've got this checkbox:

|-
! In use?:
| {{{field|IsInUse|input type=checkbox}}}
|}

The template is structured as follows:

{{#if: {{{IsInUse|"yes"}}}| <-- table gets printed --> |}}

How can I make sure to just print the table content when the box is checked and the value of "IsInUse" is set to "yes" (default = no)?

Thanks in advance,
Marcel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use value of variable in template

Yaron Koren
Hi Marcel,

This isn't actually an SMW-related issue, but in any case, I think you just
need to change that part of the template to the following:

{{#ifeq: {{{IsInUse|}}}|yes| <-- table gets printed --> |}}

-Yaron
 On Sep 7, 2012 2:45 PM, "Marcel Be" <[hidden email]> wrote:

> Hello all,
>
> I'm stuck right now at what I remeber to be a simple thing.
> In a Form variables of a certain group get a value and can be flagged as
> used or not used with a checkbox, which allows to deselect the whole
> content-group by just not checking the box. That's the idea so far.
>
> In the form I've got this checkbox:
>
> |-
> ! In use?:
> | {{{field|IsInUse|input type=checkbox}}}
> |}
>
> The template is structured as follows:
>
> {{#if: {{{IsInUse|"yes"}}}| <-- table gets printed --> |}}
>
> How can I make sure to just print the table content when the box is checked
> and the value of "IsInUse" is set to "yes" (default = no)?
>
> Thanks in advance,
> Marcel
>
>
>
>
> --
> View this message in context:
> http://wikimedia.7.n6.nabble.com/Use-value-of-variable-in-template-tp4984827.html
> Sent from the Semantic Mediawiki - User mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use value of variable in template

Marcel Be
Yes, you're right, it isn't a specific SMW topic but nonetheless thanks a lot !!

Marcel
Loading...