Permanently protected template

Difference between revisions of "Template:IfSemantics"

From Yugipedia
Jump to: navigation, search
(simpler syntax, and without any db queries (unless I'm mistaken and #arraymap is waaay less efficient than it could be))
(update SMW check)
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<noinclude>{{TagSyncPage}}
+
{{ safesubst:<noinclude/>#varexists: $smw || {{ safesubst:<noinclude/>#vardefine: $smw | {{ safesubst:<noinclude/>#if: {{ safesubst:<noinclude/>#set: }} || 1 }} }} }}{{ safesubst:<noinclude/>#if: {{ safesubst:<noinclude/>#var: $smw }} | {{{1|1}}} | {{{2|}}} }}<noinclude>{{documentation}}</noinclude>
</noinclude><includeonly>{{#if:{{#arraymap:}}|{{{2|}}}|{{{1|1}}}}}</includeonly><noinclude>
 
{{TagSync|include: *}}
 
{{SMW banner}}
 
 
 
{{tlx|IfSemantics}} is a template used to control how content is displayed depending on whether the extension [[smw:|Semantic MediaWiki (SMW)]] is enabled or not.
 
 
 
==Usage==
 
The content of the first unnamed parameter is what displays if SMW is enabled. The content of the second unnamed parameter is what will be displayed if SMW is not enabled.
 
 
 
For example. {{tlx|IfSemantics|X|Y}} will produce X if SMW is enabled and Y if it isn't enabled.
 
 
 
==See also==
 
* {{t|SMWF}}
 
* {{t|SMW banner}}
 
* {{t|SMW notice}}
 
 
 
[[Category:Templates/technical|{{PAGENAME}}]]</noinclude>
 

Latest revision as of 23:52, 25 June 2023

1