Template:Template sandbox: Difference between revisions

From Ring of Brodgar
Jump to navigation Jump to search
(Enabled line-delimiter.)
Tag: Reverted
(+Sub-paged link.)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
<noinclude >'''''{{PAGENAME}}''' page.''
<noinclude>'''''{{PAGENAME}}''' page.''
<span class="subpages" style="font-size:0.95em;">[[special:PrefixIndex/{{NAMESPACE}}:Template sandbox|Template sandbox Sup-Pages]]&nbsp;<span style="color:gray; font-size:1.25em;">&#9658;&nbsp;</span></span>
{{sandbox|:This is the RoB-template-sandbox where you can play and try out template debugging safely.
{{sandbox|:This is the RoB-template-sandbox where you can play and try out template debugging safely.
:Can be used together with the [[sandbox|general sandbox page]].
:Can be used together with the [[sandbox|general sandbox page]].
:Note: No semantic in-text annotations when used as stand-alone self-calling template.}}
:Note: No semantic in-text annotations when used as stand-alone self-calling template.}}
<!--COMMENT Feel free to temporary remove this page-header when testing. Just restore it again after your done.
<!--COMMENT Feel free to temporary remove this page-header when testing. Just restore it again after your done. --></noinclude
Additional available in-template data: https://www.semantic-mediawiki.org/wiki/Help:Plainlist_format/parameter_template
><includeonly
* querycondition: '{{{#querycondition|<empty>}}}'
* querylimit: '{{{#querylimit|<empty>}}}'
* resultoffset: '{{{#resultoffset|<empty>}}}'
* rowcount: '{{{#rowcount}}}' - is static "format=count" value.
* rownumber: '{{{#rownumber}}}' - starts counting from offset+1!
--></noinclude


><!-- code part:begin --><includeonly
>{| class="infobox boxed" style="font-size:89%; width:320px;"
|+ {{Infobox/preview_mode_note}}
! colspan="2" | {{{name|{{PAGENAME}}}}}
|- style="text-align:center;"
| colspan="2" style="padding:0.5em;" | {{Page-image-name-processing | image={{{image|}}} | imagewidth={{{imagewidth|}}} | maxsize=152 }}<p style="margin:0px;margin-top:0.5em"><i>{{{caption|{{{text|}}}}}}</i></p>
|-
! colspan="2" {{RoB_style|infoboxsection}} |
|-
| style="width:60px;" | <b>[[:Category:Medicine | Treated]] with</b>
| {{#if: {{{treatedwith|}}} | {{{treatedwith}}}
|-
| style="width:60px;" | <b>Cause</b>
| {{{cause}}}
|-
| style="width:60px;" | <b>Penalties</b>
| {{#if: {{{penalty|}}} | {{{penalty}}}
|-
| style="width:60px;" | <b>Rewards</b>
| {{#if: {{{reward|}}} | {{{reward}}}
|-
! colspan="2" | Go to ... page
|}</includeonly


>{{#if: {{{1|}}}
><noinclude>{{documentation}}</noinclude>
 
|  {{#switch: {{{1}}}
 
  | specifics = <!-- "specifics" mode -- Return specific-names list for target item.
    -->{{#if: {{{2|}}}
      | {{#ifeq:{{NAMESPACE}}|{{ns:legacy}}
        | {{#show: {{{2}}} | ?legacy-specific | format=plainlist | link = none }}
        | {{List_normalize|{{#replace: {{#replace: {{#show: {{{2}}} | ?specific | format=plainlist | link = none }} | Generics }} | {{{2|}}} }} }}
        }}<!-- if:ns:close
 
      -->{{#if: {{#pos:{{#show:{{{2}}}|?specific|format=plainlist|link=none}}|{{{2}}}}} | {{#set:Test_Text={{{2}}};{{#show:{{{2}}}|?specific|format=plainlist|link=none}}|+sep=*}} }}<!-- additional debug-data dumping.
 
    -->}}<!-- if:2:close (NOP if P2 is not given)
 
-->| #default = <!-- General mode --
  -->{{#ifeq:{{NAMESPACE}}|{{ns:legacy}}
 
    | {{#if: {{{2|}}}<!-- legacy --
    -->| {{#if: {{#ask: [[legacy-requires::{{{1}}}]]}} | {{#ask: [[legacy-requires::{{{1}}}]]}},&#32;}}{{
          #if: {{#explode:{{{2}}}|,|0}} |        <b>(</b><i>{{#explode:{{{2}}}|,|0}}</i><b>:</b>  {{#ask: [[legacy-requires::{{#explode:{{{2}}}|,|0}}]]}}<b>)</b>}}{{
          #if: {{#explode:{{{2}}}|,|1}} |, <b>(</b><i>{{trim|{{#explode:{{{2}}}|,|1}}}}</i><b>:</b> {{#ask: [[legacy-requires::{{#explode:{{{2}}}|,|1}}]]}}<b>)</b>}}{{
          #if: {{#explode:{{{2}}}|,|2}} |, <b>(</b><i>{{trim|{{#explode:{{{2}}}|,|2}}}}</i><b>:</b> {{#ask: [[legacy-requires::{{#explode:{{{2}}}|,|2}}]]}}<b>)</b>}}{{
          #if: {{#explode:{{{2}}}|,|3}} |, <b>(</b><i>{{trim|{{#explode:{{{2}}}|,|3}}}}</i><b>:</b> {{#ask: [[legacy-requires::{{#explode:{{{2}}}|,|3}}]]}}<b>)</b>}}{{
          #if: {{#explode:{{{2}}}|,|4}} |, <b>(</b><i>{{trim|{{#explode:{{{2}}}|,|4}}}}</i><b>:</b> {{#ask: [[legacy-requires::{{#explode:{{{2}}}|,|4}}]]}}<b>)</b>}}
      | {{#if: {{#ask: [[legacy-requires::{{{1}}}]]}} | {{#ask: [[legacy-requires::{{{1}}}]]}} | {{RoB color|result_none|None}} }}
      }}<!-- if:2:close -->
 
    | {{#if: {{{2|}}}<!-- main/hafen --
    -->| {{#if: {{#ask: [[requires::{{{1}}}]]}} | {{RequiredBy2/output|main|{{{1}}}}}{{RequiredBy2/output|line}}}}{{<!-- ask item-specific RB's -- next do same for specific-names -->
          #if: {{#explode:{{{2}}}|,|0}} |  {{RequiredBy2/output|type|{{#explode:{{{2}}}|,|0}}}}}}{{
          #if: {{#explode:{{{2}}}|,|1}} |{{RequiredBy2/output|line}} {{RequiredBy2/output|type|{{#explode:{{{2}}}|,|1}}}}}}{{
          #if: {{#explode:{{{2}}}|,|2}} |{{RequiredBy2/output|line}} {{RequiredBy2/output|type|{{#explode:{{{2}}}|,|2}}}}}}{{
          #if: {{#explode:{{{2}}}|,|3}} |{{RequiredBy2/output|line}} {{RequiredBy2/output|type|{{#explode:{{{2}}}|,|3}}}}}}{{
          #if: {{#explode:{{{2}}}|,|4}} |{{RequiredBy2/output|line}} {{RequiredBy2/output|type|{{#explode:{{{2}}}|,|4}}}}}}
      | {{#if: {{#ask: [[requires::{{{1}}}]]}} | {{RequiredBy2/output|main|{{{1}}}}} | {{RequiredBy2/output|none}} }}<!-- item-specific only case, no specific-names given -->
      }}<!-- if:2:close -->
 
    }}<!-- if:ns:close -->
 
  }}<!-- switch:close
 
-->| {{error|Missing input data.|RequiredBy2: }}<!--
-->}}<!-- if:1:close
 
--></includeonly
 
><noinclude><!--
 
-- usage: {{RequiredBy2 | <item-pagename> | {{RequiredBy2 | specifics | <item-pagename> }}}}
 
--><! -- Preview/Debug. --
 
x1) {{RequiredBy2 | specifics | Stinging_Nettle }} <!-- specific-names list. -->
 
x2) {{RequiredBy2 | Stinging_Nettle }} <!-- page/item specific usages only. -->
 
.... ... ...
 
:Stinging_Nettle full output:
"{{{{PAGENAME}} | Stinging_Nettle | {{{{PAGENAME}} | specifics | Stinging_Nettle}}}}"
 
.... ... ...
 
:-0) <i>(no input)</i> {{{{PAGENAME}}}}
:-1) <i>(...)</i> {{{{PAGENAME}} | foobar }}
:-2) <i>(...)</i> {{{{PAGENAME}} | foobar1 | foobar2 }}
<!--
 
:31) <i>(specifics only)</i> {{{{PAGENAME}} | Chicken_Meat | {{{{PAGENAME}} | specifics | Chicken_Meat}}}}
 
:32) <i>(specifics only)</i> {{{{PAGENAME}} | Billygoat_Horn | {{{{PAGENAME}} | specifics | Billygoat_Horn}}}}
 
:33) <i>(page only)</i> {{{{PAGENAME}} | Wooden_Shovel  | {{{{PAGENAME}} | specifics | Wooden_Shovel}}}}
Fireplace(~200)
 
:34) <i>(neither)</i> {{{{PAGENAME}} | Spitroast_Walrus | {{{{PAGENAME}} | specifics | Spitroast_Walrus}}}}
 
:35) <i>(mixed)</i> {{{{PAGENAME}} | Milk | {{{{PAGENAME}} | specifics | Milk}}}}
 
:Trailing delimiter in specific-output effect. (<i>kinda minor, fix probably not so minor</i>)
:91a) {{RequiredBy2 | Milk | }}
:91b) {{RequiredBy2 | Milk | ,,, }}
:91c) {{RequiredBy2 | Milk | Milk,,, }}
:91d) {{RequiredBy2 | Milk | ,,,Milk }}
 
-->
</noinclude>

Latest revision as of 12:12, 14 May 2023

Template sandbox page. Template sandbox Sup-Pages ► 

This is the RoB-template-sandbox where you can play and try out template debugging safely.
Can be used together with the general sandbox page.
Note: No semantic in-text annotations when used as stand-alone self-calling template.
Template documentation (for the template shown above, sometimes hidden or invisible)

Bla bla bla (Sandbox TemplateData Testcase)

TemplateData pages

JSONLint:- A tool that allows you to validate manually-written JSON to help find errors in the syntax. (Tabs indentation only output)
JSONCompare: More advanced version. Includes output options. (generally preferred: Tabs or 2 Spaces indentation.)


Templatedata Description

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
rewardreward

no description

Contentrequired
cause

no description

Stringoptional
penaltypenalty

no description

Numbersuggested
Label1treatedwith

Label1 Description

Page nameoptional