User:Neatly95/Sandbox6

The  template can be used to tabulate a list of interrelated sovereigns in a preformatted way. The template accepts arguments for the name, reign, and image of multiple sovereigns, as well as fields for remarks and alternative names.

Rationale
The table was initially designed for dynastic rulers of Ancient Egypt, but the template can be used for any dynasty-like period of sovereigns.

The template was designed to address several issues within the context of the aforementioned Ancient Egyptian use-case. Expand the following section for further details.


 * Poor referencing (WP:V): The kind of information that this template displays is liable to be reproduced elsewhere without the source. The footnotes and sources are aggregated immediately after the table using footnote groups.
 * Content forking (WP:CFORK) : This template is particularly useful for preventing content forks of convoluted or contestable information across pages whose scope overlaps other related articles. Because the template accepts footnotes and aggregates them at the end of the table, an instance of this template is safe to be transcluded from one article to another.
 * Poor legibility (WP:ACCESSIBILITY, WP:DTT): The formatting of this table is relatively more robust and its visual appearance is largely consistent. The template conforms with accessibility guidelines. The template displays differently on mobile devices; the columns are stacked vertically so the page is not stretched and users will not have to horizontally scroll.
 * Inconsistent formats (WP:MOS) : The template enforces standardised formats for dates, eras, and any uncertainty surrounding them.

Usage
The usage of this template is straightforward, however: care should be taken to ensure that parameters are named and filled correctly. The template only employs very limitied error checking in favour of flexibility of use, and improper use may produce bugs or unexpected behaviour.

Instructions
The template employs parser functions to allow it to accept arguments in a variadic way. Consequentially, it can accept an unlimited amount of entries, grouped by number, and it can also accept an unlimited amount of sources, packaged with templates.

Initialising template
The table requires four unique general parameters which apply to the whole table, and two optional parameters for style:

and  affect the colour of the header cells and the text within them. They accept CSS colors. Otherwise, the table uses default colours for the skin and theme.

The  parameter accepts the type of entry, while the   parameter accepts the period in question.

The  parameter can be used for the most appropriate descriptor for the entity's tenure.

The cited footnotes in a single instance of the template are grouped together at the end of the table. The  parameter is special; as well as providing a visual element in that its content displays in citations of footnotes within the table, i.e. –

– it also performs a semantic duty, serving as the group identifier for the citations and footnotes contained only in this instance of the table.

Adding an entry
The template requires numerous parameters to create a single entry, and additional optional parameters are available:

The parameters listed under  comrpise the full list of available parameters for an entry in the table.

All entry parameters must be postpended with a number, which corresponds to the entry position in the table, starting from  at the top of the table, then , through to   (the highest number given) at the bottom, and no parameter postpended with a particular number should appear more than once.

Some tags are mandatory and some are required in the case that others are/aren't used. Expand for a brief explanation.


 * Mandatory entry parameters : which must match   in every case;  ;.
 * Sometimes mandatory entry parameters :  and   are both mandatory only if either one of the parameters is assigned a value, and in which case   is also mandatory, and   is mandatory if neither   nor   were passed parameters; either   or   is mandatory if the other was not passed.
 * Incompatible entry parameters :,  and   are mutually incompatible, only one parameter is permitted;   and   are also mutually incompatible.

See below for full definitions of all the parameters.

Images
The template internally uses the  template to handle images, whose parameters some of which are available to use. See below for detailed definitions of the image parameters.

Footnote parameters
,,  ,   and   are parameters to which sentence-case footnotes can be passed. Though they function the same, each citation is displayed in a specific area. For example:

Renders as...



Adding sources
Adding sources to the template is simple. The  template is used to package the source which is then fed into the   template internally in a variadic way. Wikicite uses the parameters  (used to anchor the source) and   (the content of the source) which should be packaged inside the   template, i.e.  . The items can be passed as parameters to the main template.

Other than duplication of sources, this doesn't present much of an issue in the main article. However, if an instance of Dynasty table is transcluded into other articles (as is its design and purpose), sources for the table may variably: not be traceable; not be transcluded; not appear at the table end; display in an unexpected or malformed way; or other unexpected consequences.

The  template displays and anchors the source to the correct citations even in the case the table is transcluded into other articles.

For example:

Renders as...





Citing sources
Citing sources is simple. Inside a footnote parameter, simply link to the anchor of the source (specified in the  parameter of the source) and use the parenthetical citation style, like so:

date-fn=Altenmüller interprets several primary sources to indicate an approximate reign of c. 2310–2300 BC (Altenmüller 2001, p. 33)

Therefore:

Renders as:





Alteration to the template
Suggested changes to the template are welcomed, but as it is this template may be easily broken by edits. Please, be bold, but as a courtesy, if you plan on making breaking changes, please discuss it or appeal for second opinions.

Blank Template
This blank template can be copied and pasted as necessary.

Filled Example
This example will display according to your device.

Mobile Example
Please note, this example should only serve as reference to desktop devices. It is an imperfect approximation of how the template appears on mobile. Please check the mobile display on a mobile device of the Filled Example for more accurate presentation.




 * Footnotes aggregated below this table are referenced by an identifier corresponding to the period (i.e., refers to the Sixth Dynasty)



Parameters
All available parameters used by the  template are detailed below.

general parameters

 * : Background colour affects the fill colour of the header cells of the table. For legibility purposes this only displays on the desktop version; the mobile version ignores this parameter. Use a hex-color only, and do not prepend  or postpend, i.e.  . Parameter is sensitive to the American English spelling color.
 * : Works as does the  parameter, except it affects the font color of the header cells.
 * : Entity parameter (required) accepts the subject entity as a singular noun in plain text, i.e. . Please do not pluralise it, the template handles pluralisation. Displayed in table captions and headers.
 * : Tenure parameter (required) accepts the most appropriate descriptor for the tenure of the entity, i.e. "Reign" for a sovereign, "Floruit", "Tenure", "In Office", "Office Held", etc. Displayed in the table headers.
 * : Period parameter (required) accepts the period in question in plain text, i.e. . Displayed in table captions and legend.
 * : Footnote group parameter (required) takes a unique identifier which corresponds to the  parameter, used to group only the relevant footnotes referenced within the current table (and not those referenced in other tables using this template or footnotes referenced in the main article). The identifier must be unique to the article, otherwise footnotes will aggregate underneath the wrong tables, or exhibit unexpected behavour. E.g. a roman numeral or an abbreviation, i.e.   if the period parameter was , or   if the period parameter was.

entry parameters

 * : Fng ("footnote group") parameter (required) must match its namesake  in the template, i.e.,   and   if  , otherwise the footnotes will render in the wrong table (or not at all, if no table calls it).
 * : Name parameter (required) takes the name of the entity, i.e. . The name should be wrapped as a wikilink if an article exists. This parameter should only use the common name of the entity, unless the common name is a pseudonym or a byword for an unknown name, in which case   is acceptable, with the pseudonym referenced using   or.
 * : The name_sort parameter (optional) takes an entity name in alpha-numeric format, which is strongly advised in the case that the  parameter contains a roman numeral, i.e.   requires  . It is also important that single digits are prefixed with a preceding zero, i.e.   requires  . Such a parameter is necessary in order to ensure that the column can sort entities alphanumerically correctly. (Please do not attempt to use this column to sort the entities by an order other than the alphanumeric one; sorting is important for WP:ACCESSIBILITY and a requirement of good list (WP:FL?) articles).
 * : Name_fn ("name footnote") parameter takes a footnote as wikitext. It will collect beneath the table and will be cited immediately after the  of the entity, i.e.   and , and should use sentence case. Since most footnotes cite a reference, please review expected citation format.
 * : Reign_begin parameter (mandatory) takes the start year of the reign as a number only, i.e. . If it is not known, only i.e.   is appropriate. This parameter is also used to sort the column. (Please do not try to diverge from this format; it aims to be in accordance with WP:MOS cf. dates and times).
 * : This parameter (mandatory) works largely the same as the  parameter, but instead corresponds to the final year of the entity's reign. It is ignored by sorting.
 * : If no dates are known for the entity, the reign_unknown parameter (an optional parameter which takes only i.e., ) should always be used.
 * : If the years given for the reign are approximate, the optional reign_circa parameter can be used, which works the same way as  parameter.
 * : If the datation of the reign is uncertain and the years given are the flourishing years, the optional reign_fl parameter can be used, which works the same way as  parameter. This parameter is not compatible with the   parameter.
 * : The postfix parameter (mandatory if reign given) accepts a postfix, which must be BC, AD, BCE or CE. (Please do not arbitrate the use of BC/AD or BCE/CE; WP:ERA guidelines discourage the changing of an article's date format without a justifiable cause.)
 * : Reign_length parameter (mandatory) accepts a number of years for the length of reign of the entity, i.e. . This is particularly important for entities whose dated reign is unknown but the duration of their reign isn't. This parameter is used to sort the lengths of reign.
 * : This optional parameter accepts  and nothing else; it is not compatible with either   or , and it won't display if   has been specified.
 * : Indicated in the case the reign length is considerably less than a year; it works the same as.
 * : It would be used in the unusual case perhaps where the reign is known to have been of at least a certain length but significant events of the entity's reign are known to have taken place outside the evidenced range. It works the same way as does.
 * : If no length can be discerned for the entity, the length_unknown parameter (an optional parameter which takes only i.e. ) should always be used.
 * : This optional parameter ("date footnote") works as the  parameter does. The citation for the footnote appears immediately after the date range for the reign.
 * : This optional parameter also functions as  does; the citation for the footnote appears immediately after the reign length.
 * : Optionally accepts a brief remark as wikitext. Please do not stress the template with excessive information. The template is designed for list-structure articles and only the lightest annotations are acceptable (cf. WP:FL?). Consider its use appropriate only for highly pertinent information that relates to the  and the , e.g.:   is not appropriate information, whilst   is acceptable. (Please do not use  or any other formatting to decrease the text size; this is already applied within the cell and might contravene WP:ACCESSIBILITY guidelines).
 * : An optional paramter allows for an alternative name which renders in the  cell. Please do not wrap the name in wikilinks; the reference to the common   is sufficient, unless in such cases where only a pseudonym is known, as is the case for the pharaoh referred to as Finger Snail; see   for more information. (Sovereigns normally have an extended titulary but this is not always relevant to list-structure articles, so this parameter should not be used to reel off long names and titles of little consequence unless its use to differentiate from another entity is well supported).
 * : In unusual cases, if it is pertinent, a second alternative name may be added if it is well supported by literature. A good example might be,   and  . This optional parameter works similarly to  , but in the case   is not specifed,   will not render.
 * : This optional parameter functions as  does; the citation for the footnote appears immediately after the remarks.
 * : Another optional parameter which functions as  does; the citation for the footnote appears immediately after the alternative name(s).
 * : Img parameter accepts a file-name. Please do not prepend ; the template already handles this. The template then crops the image to uniform size.
 * : If there is an image file provided, a brief alternative text must be provided for accessibility reasons, as plain text.
 * : The img_base_size parameter is optional, but advised if you have an image. It takes a width in pixels and scales the image accordingly, prior to cropping, i.e. . It is easier to think of this as how zoomed out the image is compared to the little uniform window. Experimentation is recommended. It is strongly advised that the range for this figure is.
 * : Again, optional but advised if you have an image. It takes a number in pixels, as  does. Offsets the crop frame (gives the impression that the image is moving up in the little uniform window, the greater the value). Experimentation is recommended.
 * : Works as does  (gives the impression the image is moving left in the little uniform window, the greater the value).

Issues
Future updates may address issues with the template. Expand for more information.


 * Squashed columns on mobile : In some unlikely circumstances (those where large amounts of the available optional parameters are left empty for all entries, i.e. tenure unknown, no remarks, no image), the columns on mobile can become a little squashed, although this is just a visual defect since those columns are "empty" in these scenarios and this shouldn't occur at all if the table is well filled. The root cause of this seems to be something to do with the "Remarks" box, however further investigation is required.
 * Parenthetical citations : Future versions of the template may attempt to update the citation method to avoid using them in favour of superscripted citation numbers.
 * Customisable legend : A customisable legend may be considered.