Template:SourceToggle: Difference between revisions

From Heroes 3 wiki
Jump to navigation Jump to search
No edit summary
(allow for duplicate parameters)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#ifeq:{{{2}}}|hota|onlyhota}}{{#ifeq:{{{2}}}|dor|onlydor}}{{#ifeq:{{{2}}}|hidewithhota|onlysod}}{{#ifeq:{{{2}}}|hidewithdor|onlynodor}}{{#ifeq:{{{1}}}|Horn of the Abyss|onlyhota}}{{#ifeq:{{{1}}}|Day of Reckoning|onlydor}}</includeonly><noinclude>
<includeonly>{{#switch:{{{1|}}}| hota|Horn of the Abyss = onlyhota | dor|Day of Reckoning = onlydor | {{#switch:{{{2|}}}| hota = onlyhota | dor = onlydor | sod|hidewithhota = onlysod | hidewithdor = onlynodor}}}}</includeonly><noinclude>


Usage:
Usage:
<pre>class='{{sourceToggle|{{{source}}}|{{{only}}}}}'</pre>
<pre>class='{{sourceToggle|{{{source}}}|{{{only}}}}}'</pre>


*For compatibility with older content, unofficial expansion can use the source (1) variable (Horn of the Abyss / Day of Reckoning).
*For compatibility with older content, unofficial expansion can use the source (1) variable (Horn of the Abyss / Day of Reckoning / hota / dor).
*To hide official content use the only (2) variable (hidewithhota / hidewithdor).
*To hide official content use the only (2) variable (hidewithhota / hidewithdor / sod).
*Unofficial content can also use the only (2) variable (hota / dor).
*Unofficial content can also use the only (2) variable (hota / dor).
== Examples ==
* <nowiki>{{SourceToggle|hota|}}</nowiki>: {{SourceToggle|hota|}}
* <nowiki>{{SourceToggle|hota|hota}}</nowiki>: {{SourceToggle|hota|hota}}
* <nowiki>{{SourceToggle|dor|}}</nowiki>: {{SourceToggle|dor|}}
* <nowiki>{{SourceToggle||hidewithhota}}</nowiki>: {{SourceToggle||hidewithhota}}
* <nowiki>{{SourceToggle||sod}}</nowiki>: {{SourceToggle||sod}}
* <nowiki>{{SourceToggle||hota}}</nowiki>: {{SourceToggle||hota}}
* <nowiki>{{SourceToggle||dor}}</nowiki>: {{SourceToggle||hidewithhota}}


[[Category: Help templates]]</noinclude>
[[Category: Help templates]]</noinclude>

Latest revision as of 13:03, 1 October 2024


Usage:

class='{{sourceToggle|{{{source}}}|{{{only}}}}}'
  • For compatibility with older content, unofficial expansion can use the source (1) variable (Horn of the Abyss / Day of Reckoning / hota / dor).
  • To hide official content use the only (2) variable (hidewithhota / hidewithdor / sod).
  • Unofficial content can also use the only (2) variable (hota / dor).

Examples[edit | hide | hide all]

  • {{SourceToggle|hota|}}: onlyhota
  • {{SourceToggle|hota|hota}}: onlyhota
  • {{SourceToggle|dor|}}: onlydor
  • {{SourceToggle||hidewithhota}}: onlysod
  • {{SourceToggle||sod}}: onlysod
  • {{SourceToggle||hota}}: onlyhota
  • {{SourceToggle||dor}}: onlysod