Jump to content

Template:Constituency Teachtaí Dála navbox: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
update from /sandbox
oops! checks moved to Template:Constituency Teachtaí Dála navbox/checks, and done only in template namespace
Line 8: Line 8:


}}<!--
}}<!--
# First, check config, but only if we are in template namespace
-->{{#ifeq: {{#invoke:String|match|{{FULLPAGENAME}}|Template:.+ %(Dáil constituency%)/TDs$|1|1|false|NOMATCH}}<!--
-->{{Template other|{{Constituency Teachtaí Dála navbox/checks|{{{1|}}}}}}}<!--
-->|NOMATCH<!--
# Now call /core
-->|<!-- # Bad pagename
-->{{Error|message={{tl|Constituency Teachtaí Dála navbox}} '''Bad pagename'''.<br /><!--
-->{{Constituency Teachtaí Dála navbox/core<!--
-->|constituency={{#invoke:String|replace<!--
-->{{tl|Constituency Teachtaí Dála navbox}} may be used ONLY on a page named <!--
-->"Template:''Foo''&nbsp;(Dáil&nbsp;constituency)/TDs", <!--
-->|source={{{1|}}}<!--
-->where ''[[Foobar|Foo]]'' is a placeholder for e.g. "Kildare&nbsp;South"<!--
-->|pattern=^(.+) %(Dáil constituency%)<!--
-->}}<!--
-->|replace=%1<!--
-->|plain=false<!--
-->{{Template other|[[Category:Constituency Teachtaí Dála navbox errors]]}}<!--
-->}}<!--
-->|<!-- # valid pagename. Now: do we have a parameter?
-->{{#if: {{{1|}}}<!--
-->|diagnose={{Yesno-no|{{{diagnose|{{{diagnosing|}}}}}}}}<!--
-->|<!-- # YES, we have a parameter
# Now: does the parameter match the pagename?
-->{{#ifeq: {{BASEPAGENAME}} | {{{1|}}}<!--
-->|<!-- # YES, parameter matches pagename
-->{{#ifexist: {{{1|}}}<!--
-->|<!-- # YES, parameter is the name of an existing article
# ... so invoke /core to make the navbox
-->{{Constituency Teachtaí Dála navbox/core<!--
-->|constituency={{#invoke:String|replace<!--
-->|source={{{1|}}}<!--
-->|pattern=^(.+) %(Dáil constituency%)<!--
-->|replace=%1<!--
-->|plain=false<!--
-->|diagnose={{Yesno-no|{{{diagnose|{{{diagnosing|}}}}}}}}<!--
-->}}<!--
-->}}<!--
-->|<!-- # NO, parameter is NOT the name of an existing article
-->{{Error|message={{tl|Constituency Teachtaí Dála navbox}}: <!--
-->'''Non-existent page'''.<br /><!--
-->The parameter <code>{{{1|}}}</code> matches the name <!--
-->of this page, but the article <br /><!--
-->{{nowrap|[[{{{1|}}}]]}} does not exist.<!--
-->}}<!--
-->{{Template other|[[Category:Constituency Teachtaí Dála navbox errors]]}}<!--
-->}}<!--
-->|<!-- # NO, parameter doesn't match pagename
-->{{Error|message={{tl|Constituency Teachtaí Dála navbox}} '''Mismatch'''.<br /><!--
-->The parameter ''must'' be <!--
-->''exactly'' the same as the name of this template page <!--
-->(minus the "/TDs" suffix), but here we have:<br /><!--
-->''page'': {{FULLPAGENAME}}<br /><!--
-->''parameter'': {{{1|}}}<!--
-->}}<!--
-->{{Template other|[[Category:Constituency Teachtaí Dála navbox errors]]}}<!--
-->}}<!--
-->|<!-- # NO parameter
-->{{Error|message={{tl|Constituency Teachtaí Dála navbox}} '''Missing parameter'''.<br /><!--
-->This template requires one parameter, <!--
-->which must be the name of a constituency article.<br /><!--
-->e.g. for [[Kildare South (Dáil constituency)]], create <!--
-->[[Template:Kildare South (Dáil constituency)/TDs]] with the content <!--
--><code><nowiki>{{Constituency Teachtaí Dála navbox|Kildare South (Dáil constituency)}}</nowiki></code><!--
-->}}<!--
-->{{Template other|[[Category:Constituency Teachtaí Dála navbox errors]]}}<!--
-->}}<!--
-->}}<!--
-->}}<!--
--></includeonly><noinclude>{{documentation}}</noinclude>
--></includeonly><noinclude>{{documentation}}</noinclude>

Revision as of 21:45, 11 July 2023