User:Simant/Sandbox

{{#arraymap:{{{value|}}}|{{{LineDelim|,}}}|__$SIP_VarLineItem$__|{{#vardefine:varDataLine|{{#explode:__$SIP_VarLineItem$__|{{{ExtraInfoDelim|~}}}}}}}{{#if:{{{RegexPrepend|}}}|{{#vardefine:RegexPrependLine|{{#var:varDataLine}}}}{{#vardefine:varRegexIndex|0}}{{#arraymap:{{{RegexPrepend|}}}|\n|__$SIP_RegexPrepend$__|{{#vardefine:varRegexPrepend|{{#regex:{{#var:RegexPrependLine}}|%^(__$SIP_RegexPrepend$__)%}}}}{{#if:{{#var:varRegexPrepend}}|{{#if:{{#explode:{{{RegexPrependTemplate|}}}| |{{#var:varRegexIndex}}}}|{{Template:{{#explode:{{{RegexPrependTemplate|}}}| |{{#var:varRegexIndex}}}}|{{#var:varRegexPrepend}}}}|{{#var:varRegexPrepend}}}}{{#vardefine:RegexPrependLine|{{#sub:{{#var:RegexPrependLine}}|{{#len:{{#var:varRegexPrepend}}}}}} }}{{#vardefine:varRegexIndex|{{#expr:{{#var:varRegexIndex}}+1}}}}|}}}}{{#if:({{{RegexPrepend|}}}{{{RegexAppend|}}}|{{#vardefine:varDataLineClean|{{#regex:{{#var:varDataLine}}|%(^({{#arraymap:{{{RegexPrepend|}}}|\n|_var_|(_var_)?|}})){{!}}(({{#arraymap:{{{RegexAppend|}}}|\n|_var_|(_var_)?|}})$)%| }}}}|{{#vardefine:varDataLineClean|{{#var:varDataLine}}}}}}{{#if:{{#var:varDataLineClean}}|{{#arraymap:{{#var:varDataLineClean}}|{{{SameLineDelim|/}}}|__$SIP_VarDataItem$__|{{#vardefine:ShowItem|false}}{{#switch:{{#explode:{{{linkOptions|default}}}|:|0}}                    |Form                    |Wikipedia                    |default={{#vardefine:varDataItem|{{#regex:__$SIP_VarDataItem$__|%^\[\[(?P[^\[\]<>{}\{{!}}\r\n]+)(?P\{{!}}((?!\[\[{{!}}\]\])[^\r\n\{{!}}])+)?\]\]$%|$1$2}}}}{{#vardefine:varDataItem|{{#replace:{{#var:varDataItem}}|;|{{!}}}}}} |{{#vardefine:varDataItem|__$SIP_VarDataItem$__}} }}{{#vardefine:varDataItemValue|{{#explode:{{#var:varDataItem}}|{{!}}|0}}}}{{#if:{{{RegexLineCondition|}}}|{{#if:{{#regex:{{#var:varDataItemValue}}|%^({{{RegexLineCondition}}})$%}}|{{#vardefine:ShowItem|true}}}}|{{#if:{{#explode:{{#var:varDataItem}}|{{!}}|0}}|{{#vardefine:ShowItem|true}}}}}}{{#ifeq:{{#var:ShowItem}}|true|{{{PrependText|}}}{{#if:{{#explode:{{#var:varDataItem}}|{{!}}|1}}|{{#vardefine:varDataItemDisplayName|{{#explode:{{#var:varDataItem}}|{{!}}|1}}}}|{{#vardefine:varDataItemDisplayName|{{#var:varDataItemValue}}}}}}{{#switch:{{#explode:{{{linkOptions|default}}}|:|0}} |Semantic Unit=%{{{SemanticPropertyUnit}}}$%|$1}} {{{SemanticPropertyUnit}}} |Form |Wikipedia

|default={{#ifexist:{{#var:varDataItemValue}}|{{#if:{{{Icon Type|}}}|{{#vardefine:FileLink|{{SemanticInputParser/icon|{{{Icon Type}}}|{{#var:varDataItemValue}}}}}}{{#ifexist:File:{{#var:FileLink}}| }}}}{{#var:varDataItemDisplayName}}|{{#if:{{{Icon Type|}}}|{{#vardefine:FileLink|{{SemanticInputParser/icon|{{{Icon Type}}}|{{#var:varDataItemValue}}}}}}{{#ifexist:File:{{#var:FileLink}}|  }}}}{{#switch:{{#explode:{{{linkOptions|default}}}|:|0}} |Form={{#formlink:form={{#explode:{{{linkOptions}}}|:|1}} |link text={{#var:varDataItemDisplayName}} |target={{#explode:{{#var:varDataItemValue}}|#}} |tooltip=Click here to create this page. }}                                     |Wikipedia={{#var:varDataItemDisplayName}} |default={{#var:varDataItemDisplayName}}}}}}{{#if:{{{SemanticPropertyName|}}}|{{#set:{{{SemanticPropertyName}}}={{#var:varDataItemValue}}{{{SemanticPropertyUnit|}}}}}}} |none={{#var:varDataItemDisplayName}}{{#if:{{{SemanticPropertyName|}}}|{{#set:{{{SemanticPropertyName}}}={{#var:varDataItemValue}}{{{SemanticPropertyUnit|}}}}}}}}}{{{AppendText|}}}{{#if:{{{SemanticPropertyName|}}}|{{#ifeq:{{{SearchByProperty|false}}}|true|{{#vardefine:SimilarPropertyCount|{{#ask:{{{SemanticPropertyName}}}::{{|format=count}}}}{{#ifexpr:{{#var:SimilarPropertyCount}}>1| [{{SERVER}}/w/{{#special:SearchByProperty}}?property={{urlencode:{{{SemanticPropertyName}}}|WIKI}}&value={{urlencode:{{#var:varDataItemValue}}}} {{SERVER}}/extensions/SemanticMediaWiki/skins/images/searchgray_iconsmall.png] }}}}}}|{{#if:{{{RegexLineCondition|}}}| {{SERVER}}/extensions/SemanticMediaWiki/skins/images/warning.png The input &quot;{{#var:varDataItem}}&quot; does not meet the Regular expression condition: ({{{RegexLineCondition}}}). }}{{#if:{{{SemanticPropertyName|}}}|{{#set:Has improper value for={{{SemanticPropertyName}}}}}|{{#set:Has improper value for=SemanticInputParser}}}}}}|{{{SameLineDelim|/}}}}}}}{{#if:{{{RegexAppend|}}}|{{#vardefine:varRegexAppend|{{#regex:{{#var:varDataLine}}|%({{{RegexAppend}}})$%}}}}{{#if:{{#var:varRegexAppend}}| {{#if:{{{RegexAppendTemplate|}}}|{{Template:{{{RegexAppendTemplate}}}|{{#var:varRegexAppend}}}}|{{#var:varRegexAppend}}}}}}}}{{#vardefine:VarExtra|{{#explode:__$SIP_VarLineItem$__|{{{ExtraInfoDelim|~}}}|1}}}}{{#if:{{#var:VarExtra}}|  ({{#var:VarExtra}})}}{{#vardefine:VarExtraSup|{{#explode:__$SIP_VarLineItem$__|{{{ExtraInfoDelim|~}}}|2}}}}{{#if:{{#var:VarExtraSup}}|  {{sup|({{#var:VarExtraSup}})}}}}|{{{NewLineDelim|\n\n*}}}}}  {{Documentation}}