Thread:Semantic-mediawiki.org:Community portal/If-then functionality with regard to Semantic Forms & Templates

I'm in the very, very, very early stages of putting together a wiki for my friends and I to create custom content for a roleplaying game we play, called Pathfinder. I'm trying to use semantic forms and templates to simplify the addition of new content to this site, and I've hit a brick wall. Here are the relevant pages:

The template I'm working on: The form I'm working on: An example of a page that uses this template:

I've got the form where I want it for the most part, but I want to be able to include, disinclude, or reformat some aspects of the template based on answers people provide in the form when creating pages. For instance, descriptors are optional. When one or more descriptors are chosen for the spell in question, those descriptors should be enclosed in brackets with commas in between each descriptor. The commas are easy based on the arraymap function, but making optional brackets seems it would require some sort of if-then functionality (ie. IF at least one descriptor is chosen THEN surround the descriptors with brackets).

There are also certain fields (like saving throw and spell resistance) that I want to be hidden if the range of the spell is personal. And further, there are a number of boolean properties (harmless, object, dimissable, shapeable) which should be displayed in one particular way if the answer is "yes" (for instance, if dismissable is "yes" it should be displayed as "(D)") or not at all if the answer is "no." This all seems really, really easy to do with if-then functions, but I'm a novice when it comes to wiki syntax and especially to semantic mediawiki syntax, and I wondered how possible this all is.

Please help! And thanks in advance!