Template:Constituency Teachtaí Dála navbox/doc

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
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
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: 

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
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
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?
Succession box and the S-start series are widely used. (, 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, 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
This functionality of this meta-template relies heavily on the assumption that every article on a Dáil constituency will consistently retain these attributes: Irish TD table begin etc work with this navbox by
 * 1) 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)
 * 2) have a section named "TDs" which lists the Teachtaí Dála (TDs) for that constituency, and only for that constituency
 * 3) there will be a one-to-one relationship between the name of a constituency and the name of the corresponding Wikipedia article.
 * 4) 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)".
 * 1) *a) supressing refs and notes when used in a navbox, and
 * 2) *b) omitting their heading, which is redundant in the navbox.
 * 3) *c) linking only the names of TDs, but not elections, parties or the nth Dáil

If these assumptions change
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. 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. However, any inconsistency of section headings will probably break this template irreparably. 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. (, there are only 121 articles for constituencies of the Second Dáil onwards.)
 * 1) 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.
 * 1) 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.
 * 1) 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.
 * 2) Abandonment of the Irish TD table begin series might be possible if some means is found of adjusting the new output.

Superfluous content in the navbox
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:

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 tags (per WP:PARTRANS), as done in this edit. 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.
 * 1) The TDs section of the constituency includes text to accompany the table.
 * 1) The table of TDs includes references or notes.

Categorisation
Navboxes created using this metatemplate are automatically added to
 * Category:Constituency Teachtaí Dála navigational boxes ( pages)

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 ( pages)

Tracking
All navboxes using this metatemplate are listed at:
 * Category:Navboxes using Template:Constituency Teachtaí Dála navbox ( pages)

Errors in the use of this metatemplate are tracked at:
 * Category:Constituency Teachtaí Dála navbox errors ( pages)

Sub-templates

 * Template:Constituency Teachtaí Dála navbox/core
 * Template:Constituency Teachtaí Dála navbox/checks
 * Template:Constituency Teachtaí Dála navbox/shared doc &mdash; a shared documentation page used on every navbox built with this metatemplate.