Jump to content

Template:LabelOrElse: Difference between revisions

From Philosophical Research
allow Research: links
m clean up switch statement
Line 1: Line 1:
<onlyinclude>{{#if:{{{I|}}}|{{Template:I{{{I|}}}|Q={{{Q|}}}|class={{{class|}}}}}}}<data value="{{{E|}}}{{{Q|}}}" class="item-name plainlinks">{{#switch:{{{ParameterThatShouldAlwaysBeEmpty|}}}|{{{E|}}}{{{href|}}}={{#if:{{{2|}}}|[[Ontology:Q{{{Q|617}}}|{{{2}}}]]|[[Ontology:Q{{{Q|617}}}|{{{1|(Item name missing)}}}]]}}|{{{Q|}}}{{{href|}}}={{#if:{{{2|}}}|[[Ontology:{{{E|Q617}}}|{{{2}}}]]|[[Ontology:{{{E|Q617}}}|{{{1|(Item name missing)}}}]]}} | {{{Q|}}}{{{E|}}}{{{href|}}} = {{#if: {{{2|}}} | [[Philosophical Research:{{{R}}}|{{{2}}}]] | [[Philosophical Research:{{{R}}}|{{{1|(Item name missing)}}}]] }} |#default = {{#if: {{{2|}}} | [{{{href|}}} {{{2}}}] | [{{{href|}}} {{{1|(Item name missing)}}}]}}}}</data></onlyinclude><!--
<onlyinclude>{{#if:{{{I|}}}|{{Template:I{{{I|}}}|Q={{{Q|}}}|class={{{class|}}}}}}}<data value="{{#if:{{{Q|}}}|Q{{{Q|}}}|{{{E|}}}}}" class="item-name plainlinks">{{#switch:{{{ParameterThatShouldAlwaysBeEmpty|}}} | {{{E|}}}{{{R|}}}{{{href|}}} = [[Ontology:Q{{{Q|617}}}|{{{2|{{{1|(Item name missing)}}}}}}]] | {{{E|}}}{{{Q|}}}{{{href|}}} = [[Philosophical Research:{{{R}}}|{{{2|{{{1|(Item name missing)}}}}}}]] | {{{Q|}}}{{{R|}}}{{{href|}}} = [[Ontology:{{{E|Q617}}}|{{{2|{{{1|(Item name missing)}}}}}}]] | #default = {{#if: {{{2|}}} | [{{{href|}}} {{{2}}}] | [{{{href|}}} {{{1|(Item name missing)}}}] }} }}</data></onlyinclude><!--
more readable version:
more readable version:


{{#if:{{{I|}}} |  {{Template:I{{{I|}}} |Q={{{Q|}}} |class={{{class|}}} }}  }}
{{#if:{{{I|}}} |  {{Template:I{{{I|}}} |Q={{{Q|}}} |class={{{class|}}} }}  }}
<span class="item-name">{{#switch:{{{ParameterThatShouldAlwaysBeEmpty|}}}
<data class="item-name">
| {{{E|}}}{{{R|}}}{{{href|}}} = {{#if: {{{2|}}} | [[Ontology:Q{{{Q|617}}}|{{{2}}}]] | [[Ontology:Q{{{Q|617}}}|{{{1|(Item name missing)}}}]] }}
{{#switch:{{{ParameterThatShouldAlwaysBeEmpty|}}}
| {{{Q|}}}{{{R|}}}{{{href|}}} = {{#if: {{{2|}}} | [[Ontology:{{{E|Q617}}}|{{{2}}}]] | [[Ontology:{{{E|Q617}}}|{{{1|(Item name missing)}}}]] }}
| {{{E|}}}{{{R|}}}{{{href|}}} = [[Ontology:Q{{{Q|617}}}|{{{2|{{{1|(Item name missing)}}}}}}]]
| {{{Q|}}}{{{E|}}}{{{href|}}} = {{#if: {{{2|}}} | [[Philosophical Research:{{{R}}}|{{{2}}}]] | [[Philosophical Research:{{{R}}}|{{{1|(Item name missing)}}}]] }}
| {{{E|}}}{{{Q|}}}{{{href|}}} = [[Philosophical Research:{{{R}}}|{{{2|{{{1|(Item name missing)}}}}}}]]
| {{{Q|}}}{{{R|}}}{{{href|}}} = [[Ontology:{{{E|Q617}}}|{{{2|{{{1|(Item name missing)}}}}}}]]
| #default = {{#if: {{{2|}}} | [{{{href|}}} {{{2}}}] | [{{{href|}}} {{{1|(Item name missing)}}}] }}
| #default = {{#if: {{{2|}}} | [{{{href|}}} {{{2}}}] | [{{{href|}}} {{{1|(Item name missing)}}}] }}
}}</span>
}}</span>

Revision as of 03:23, 28 February 2026

(Item name missing)

Parameters

  • 1 - primary label
  • 2 - alternate label
  • E - Item identifier including "Q" etc. If not supplied, Q will be used
  • Q - Item number not including "Q"
  • R - Philosophical Research: entry, to be used instead of Q or E
  • href - external link
  • I - swatch icon (optional)
  • class - swatch color for icon (optional)