Template:Constituency Teachtaí Dála navbox/sandbox
This is the template sandbox page for Template:Constituency Teachtaí Dála navbox (diff). |
This template should not be substituted. |
This template employs intricate features of template syntax.
You are encouraged to familiarise yourself with its setup and parser functions before editing the template. If your edit causes unexpected problems, please undo it quickly, as this template may appear on a large number of pages. You can conduct experiments, and should test all major changes, in either this template's sandbox, the general template sandbox, or your user space before changing anything here. |
This template is under development. See the ongoing discussion at WT:WikiProject Ireland#TD_and_MEP_articles_and_the_'s-par'_template ... and especially the sub-thread on the development of this template: WT:WikiProject Ireland#A neat solution for TD navboxes. |
This is a metatemplate to allow the easy creation of navbox templates to assist readers to navigate between biographical articles on Teachtaí Dála (TDs) who were elected to Dáil Éireann by the same Dáil constituency.
For example, this template is used to create the navbox {{Kildare South (Dáil constituency)/TDs}}, which can be seen in use at the bottom of the article Seán Power (politician).
Design
[edit]This metatempate works by automagically scraping the list of TDs from the Wikipedia article on the constituency, which is then reformatted and wrapped in a {{Navbox}}. That makes it very quick and simple to create navboxes which will automatically remain synchronised with the constituency article. It avoids any need to maintain two copies of the same list of TDs.
The price of this simplicity is that for technical reasons, it has to be hyper-pedantic about the name of the navbox being created, and about the one parameter needed. If it is not used precisely as designed, it displays big red error messages.
Usage
[edit]To create a navbox for TDs for a given Dáil constituency:
- create a page whose name is "Template:" + NameOfConstituencyArticle + "/TDs".
e.g. for Kildare South (Dáil constituency), create Template:Kildare South (Dáil constituency)/TDs.
Note that the "NameOfConstituencyArticle" must be precise. No variation at all is permitted, not even extra spaces.
In that new template page, add only the following: {{Constituency Teachtaí Dála navbox|{{Subst:BASEPAGENAME}}}}
Preview the page to check that there are no error messages and the navbox displays as intended. Then save.
Your new navbox is now ready for use on the biographical articles for that set of TDs.
Substitution
[edit]Do not substitute this metatemplate.
At best that would create a pile of ugly code in the navbox, rather than a simple one-line use of the metatemplate.
At worst, it might break the dynamic synchronisation between the navbox and the constituency article.
Scope
[edit]This template is for use only in relation to constituencies of the Second Dáil onwards.
The First Dáil used the 103 Westminster constituencies created by the Redistribution of Seats (Ireland) Act 1918, of which only two had more than one seat. So in all those cases, navigation of succession is best accomodated by using the {{S-start}} series of succession box templates: {{S-par/ie/oi}}, {{S-before}}/{{S-new}}, {{S-office}}, and {{S-after}}/{{S-non}}.
Why not use {{Succession box}} etc for all TDs?
[edit]{{Succession box}} and the {{S-start}} series are widely used. (As of July 2023[update], more than 239,000 pages transcude {{S-start}}). They work easily and elegantly for single-seat constituencies, where they are probably the most useful means of navigation.
Those templates do support multi-seat constituencies, but less easily and with less elegance. As the number of seats increases, and/or more terms are served, the elegance falls and the effort required to produce them grows almost exponentially. Several early Dáil constituencies had 9 seats, making it a huge task to create a succession box for e.g. Margaret Collins-O'Driscoll, who was a TD for the 9-seat Dublin City North from from 1923 to 1933.
In the discussion at WT:WikiProject Ireland#TD_and_MEP_articles_and_the_'s-par'_template, some editors preferred succession boxes over navboxes, even when there are lots of seats and/or terms; but nobody thought that making them was a good use of their time. Hence the decision to try making these navboxes.
Assumptions
[edit]This functionality of this meta-template relies heavily on the assumption that every article on a Dáil constituency will consistently retain these attributes:
- be named "Foo (Dáil constituency)", where Foo is a placeholder for the constituency name, e.g. Kildare South (Dáil constituency) or Mayo (Dáil constituency)
- have a section named "TDs" which lists the Teachtaí Dála (TDs) for that constituency, and only for that constituency
- there will be a one-to-one relationship between the name of a constituency and the name of the corresponding Wikipedia article.
- it will form its list of TDs using the {{Irish TD table begin}} series of templates, which adjust their output when used on a page whose title does not end with "(Dáil constituency)".
{{Irish TD table begin}} etc work with this navbox by- a) supressing refs and notes when used in a navbox, and
- b) omitting their heading, which is redundant in the navbox.
- c) linking only the names of TDs, but not elections, parties or the nth Dáil
If these assumptions change
[edit]Some changes in these assumptions may be accommodated by modifying templates. Other changes will break these navboxes, and/or the associated constituency articles.
Note that all the templates involved use some intricate coding. It would be best if any modifications to the templates are undertaken only by editors who are experienced in coding intricate templates.
- It should be possible to easily modify this template to work with a new naming convention, provided that the new names consistently use the same format.
However, any inconsistency of article titles will probably break this template irreparably. {{Is this a Dáil constituency article}} is used by most of the {{Irish TD table begin}} series of templates, which rely on accurate detection of whether they are being used in a Dáil constituency article. Any change in the naming convention to a new consistent format will require changes to both {{Is this a Dáil constituency article}} and {{Constituency Teachtaí Dála navbox/checks}}. - If the section currently named "TDs" is renamed to a new and consistent name, that change will be easily accommodated by modifying {{Constituency Teachtaí Dála navbox/core}}.
However, any inconsistency of section headings will probably break this template irreparably. - Abandonment from the one-to-one relationship between the name of a constituency and the name of the corresponding Wikipedia article will at best cause this template to produce ugly output, and may break it entirely. In either case, modifying this template to support to support merged or split constituency articles would be at best a non-trivial task; at worst it would be impossible without adding grossly undue complexity.
- Abandonment of the {{Irish TD table begin}} series might be possible if some means is found of adjusting the new output.
However, tests conducted when this meta-template was being developed seemed to indicate that if this meta-template needed to to do this reformatting, it would probably need to be implemented as a custom Lua module. In that situation, editors should consider when the added complexity is appropriate for a relatively small set of articles. (As of July 2023[update], there are only 121 articles for constituencies of the Second Dáil onwards.)
Superfluous content in the navbox
[edit]A navbox is for navigation, not explanation. Like a road sign, it should consist only the minimum information needed to navigate. For navboxes, that means only links to the articles in the set, which in this case is the set of TDs for that constituency.
Two situations have been found where a navbox included other content:
- The TDs section of the constituency includes text to accompany the table.
See e.g. Cork Mid, North, South, South East and West (Dáil constituency), which as of July 2023 includes a paragraph on the constituency's most notable TD. (Permalink to revision with this content).
Navboxes built using this metatemplate transclude all of the "TDs" section of the article, so this text was appearing in the navbox {{Cork Mid, North, South, South East and West (Dáil constituency)/TDs}}.
The remedy was to wrap the extra text in<noinclude> .. </noinclude>
tags (per WP:PARTRANS), as done in this edit. - The table of TDs includes references or notes.
Most constituency articles rightly include references for the table of TDs, usually as a ref beside the name of the election. Some articles also include a note beside one or more individual TDs, noting e.g. that as Ceann Comhairle they were automatically re-elected, or that a TD who was elected as an independent was part of a group which was not at the time registered as a political party.
The refs and notes are helpful and appropriate in the article, but they do not belong in the navbox.
The remedy is to place the ref or note in the|refs=
parameter of the templates used to build the table of TDs: {{Irish TD table begin}}, {{Irish TD table Dáil}}, {{Irish TD table TD with party link}} etc.
See e.g. this fix to Carlow–Kilkenny; this fix to Kildare South; or this fix to Roscommon–South Leitrim.
Categorisation
[edit]Navboxes created using this metatemplate are automatically added to
Articles which transclude a navbox created using this metatemplate are automatically added to
- Category:Articles using a navbox created with Template:Constituency Teachtaí Dála navbox (1,327 pages)
Tracking
[edit]All navboxes using this metatemplate are listed at:
Errors in the use of this metatemplate are tracked at:
Sub-templates
[edit]- Template:Constituency Teachtaí Dála navbox/core
- Template:Constituency Teachtaí Dála navbox/checks
- Template:Constituency Teachtaí Dála navbox/shared doc — a shared documentation page used on every navbox built with this metatemplate.