I don't know why exactly this is failing, but if you split up the "#switch" call and the SMW call into two separate parts, it should work. The template could look more like this:

|{{#switch: {{{works|}}}
 | yes

...plus all the rest, and then this:

[[Does it work::{{{works|}}}]]

You can refer to a value more than once in the same template.

-Yaron



On Nov 30, 2007 10:53 PM, <dirtie@gmail.com > wrote:
I'm afraid I'm not too knowledgeable on the technical aspects of this, but here goes.
 
I have a template which I want to convert for use with Semantic MediaWiki (already set up on a local testing server, 1.0RC2). However, it makes use of the {{#switch}} function contained in the ParserFunctions extensions.
 
What it does is colour the background of a table cell a different colour depending on the value in the argument/variable.
 
So currently it looks like:
 
|{{#switch: {{{works|}}}
 | yes
 | YES
 | Yes = style="background:palegreen"
 | no
 | NO
 | No = style="background:salmon"
 | partial
 | PARTIAL
 | Partial = style="background:skyblue"
}}|{{{celltext|}}}
 
Converted to be property-based for use with SMW it looks like this:
 
|{{#switch: [[Does it work::{{{works|}}}]]
 | yes
 | YES
 | Yes = style="background:palegreen"
 | no
 | NO
 | No = style="background:salmon"
 | partial
 | PARTIAL
 | Partial = style="background:skyblue"
}}|[[Cell text::{{{50note|}}}]]
 
The function obviously doesn't recognize the argument since it's not formatted for correct use with it.
 
I'm sure there's something missing here, but information seems to be all over the place and not so easy to find what you're looking for, or to understand it (or maybe I'm just useless).

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Semediawiki-user mailing list
Semediawiki-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-user