Revision as of 08:14, 8 October 2006 view sourceDoremítzwr (talk | contribs)1,063 editsm →Chemical abbreviations: formulas > formulae← Previous edit | Revision as of 01:49, 9 October 2006 view source Centrx (talk | contribs)37,287 edits →Deletion-process documentation: Same as oldafd, does not need to be staticNext edit → | ||
Line 91: | Line 91: | ||
* {{tl|afd bottom}}, {{tl|afd top}} | * {{tl|afd bottom}}, {{tl|afd top}} | ||
* {{tl|mfd top}}, {{tl|mfd bottom}}, | * {{tl|mfd top}}, {{tl|mfd bottom}}, | ||
* {{tl|mfd |
* {{tl|mfd}} | ||
===Misc. templates=== | ===Misc. templates=== |
Revision as of 01:49, 9 October 2006
This page documents an English Misplaced Pages ]. Editors should generally follow it, though exceptions may apply. Substantive edits to this page should reflect consensus. When in doubt, discuss first on this guideline's talk page. |
]
This page lists templates that should always be substituted except in the Misplaced Pages namespace. Automated tools (bots) which do such replacements will never be used on the original template pages.
If you are going to use a bot to substitute templates, please read through the talk page first, as many are under dispute or change status over time, and substitution is permanent.
About subst
Definition
The subst: keyword (short for "substitution") is used as a prefix inside a template code. It changes the way the software expands the template. Ordinarily, a template is expanded "on the fly"; that is, the template code calls a separate page for the text every time someone edits a page it's used on. Placing "subst:" inside the curly brackets tells the software to permanently substitute the template with text of the template (that is, the text that is on the template's article page). Therefore {{template}} becomes {{subst:template}} and the full text is expanded when you save the page.
Usage
Note: Template substitution is a permanent change that removes functionality; it should generally be avoided without a good reason.
You can subst a template tag by adding "subst:" to a template tag. For example, use {{subst:test5}} instead of {{test5}}. When this is a major component of an edit, it is strongly suggested that the template be mentioned in the edit summary (for instance, put "{{subst:test}}" or "test1 applied" in your edit summary so other editors can easily see what you have done). Additionally, when creating or editing templates that are commonly substituted, adding an HTML comment to the template page helps article editors to see how templates are being used (e.g. <!-- Substituted from Template:Doctl -->
).
Arguments for substitution
- Templates are often modified or deleted. If a template is boilerplate text, consider whether you want it to vary as the template is improved. If your answer is "no", substitution is warranted. An example of this is the {{welcome}} template. The archives of a user's talk page should show the actual welcome message they received, not the current welcome message.
- If there is a template you would like to modify for a single occasion, but you don't want to modify the template for all the pages that use it, and you don't want to make a new template, you can substitute the template and then with a second edit, make the modifications. For example: a template might be used with all the states in the United States and the District of Columbia. The template might be worded correctly for the states, but not for DC. To fix the wording, you can substitute the template and then fix the wording.
- Substituting frequently-used, but unprotected templates (of which there are few) limits the damage that can be caused by vandalising them. See high-risk templates.
- Using certain templates hides wikitext from newcomers, which prevents them from learning how to use it. (Of course, there is a "how to edit" link at the bottom of each edit page.)
- Substituting en masse may speed up the site, though the amount and significance of this is the subject of frequent debate. Every time a page is modified, the server must get text from a separate page for every template used. Although each individual template has little effect, the vast number of templates used on Misplaced Pages is one factor affecting server load and article load times. Chief Technical Officer Brion Vibber (who "maintain overall responsibility for all technical functions of the Foundation, including both hardware and software") has said: "'Policy' shouldn't really concern itself with server load except in the most extreme of cases; keeping things tuned to provide what the user base needs is our job."
- See Misplaced Pages:Transclusion costs and benefits for further details.
Arguments against substitution
- Once a template is substituted, the result is no longer linked to the template, making it hard to find all pages displaying that text (though categories can sometimes relieve this).
- A substituted template won't be updated when the master template is updated.
- If the template is used to standardize the appearance of something, you probably do not want to do a substitution. An example of this is a table of contents or navigation box.
- Substituting en masse — editing thousands of articles with bots — slows down the site and wastes server resources unnecessarily.
- Substitution increases the size of articles in the database and database dumps.
- A substituted template can add a lot of wiki-code or HTML to the article, harming accessibility for the less technically-inclined.
- Substituting templates prevents newcomers from learning to use templates, and prevents users from finding their documentation.
- If the template is just being used temporarily, it is usually better not to substitute. Substituted templates are much harder to remove or modify. For example the template that nominates a category for renaming {{cfr|Category name}} can easily be modified to be the template that renames the category {{category redirect|Category name}}.
- When a vandalised template is substituted, it is more difficult to repair than regular vandalism because of the lack of links between the template and its incarnations and the lack of updatability.
- Unsubstituted deletion tags for trivial pages (such as categories and redirects) offer the deleting administrator a convenient, meaningful deletion summary. Example:
"content was: '{{rfd}} #REDIRECT Misplaced Pages' (and the only contributor was 'Jimbo Wales')".
A precise deletion comment gives onlookers (especially non-administrators unable to view the deleted edits) better insight as to why a specific item may have been deleted. If templates such as {{rfd}}, {{cfr}}, etc. are substituted, the "reason for deletion" field defaults to a blank line. However, pages deleted via {{afd}} and {{mfd}} should be deleted with a link to the subpage where the deletion was discussed.
Templates that should be substituted
This is a list of templates that should always be substituted, organised by namespace. Each list is ordered alphabetically with grouped series.
Article namespace
- {{bio-cats}}
- {{chembox}}, {{chembox simple organic}}, {{chembox simple inorganic}}
- {{footnotes}}, {{Footnotestext}} — substituting these inserts a commentary only visible in edit mode, with a short explanation of how footnotes work (the first also inserts the <references/> tag),
- {{lived}} — shortcut used to add birth/death categories to biographical articles
- {{prettytable}}, {{Prettytable-center}}, {{Prettytable95}}, {{Prettytable100}}, {{Prettytable100center}}, {{Prettyinfobox}}, {{PrettytableN}}, {{Prettytablewidth}}, {{F1 race table}}, {{Prettytable-center2}}
- {{sub}}, {{sup}}
Article talk
User talk namespace
Warnings
- {{3RR}} {{3RR2}} {{3RR3}}
- {{anon vandal}}
- {{attack}} {{No personal attacks}} {{Npa}} {{Npa2}} {{Npa3}} {{Npa4}}
- {{blatantvandal}} {{bv}}
- {{blanking1}} {{blanking2}} {{blanking3}} {{blanking4}}
- {{drmafd}} {{drmafd2}} {{drmafd3}} {{drmafd4}} {{drmafd5}}
- {{Edit summary personal}} {{Editsummarynew}}
- {{MIPblock}}
- {{multipleIPs}}
- {{name your images}} {{image source}} {{image copyright}}
- {{nn-warn}}
- {{nothanks}} {{nothanks-sd}}
- {{obscene}}
- {{sofixit}}
- {{subst}}
- {{Summary}} {{Edit summary}}
- {{spam}} {{spam2}} {{spam2a}} {{spam3}} {{spam4}}
- {{test-self}}
- {{test-n}} {{test2-n}} {{test2a}} {{test2a-n}} {{test2b}} {{test3-n}} {{test4a}} {{test4-n}}
- {{test}} {{test0}} {{test1}} {{test2}} {{test2a}} {{test3}} {{test4}} {{test5}} {{test6}}
- {{UsernameBlocked}}
- {{vanity}}
- {{vblock}}
- {{verror}} {{verror2}} {{verror3}} {{verror4}}
- {{vw}}
Suggestions
- {{Award}}, {{Award2}}
- {{newvoter}}
- {{welcome}} {{welcome2}} {{welcome3}} {{welcome4}} {{welcomeip}} {{anon}} {{welcome-anon}} {{welcome-anon-from}} — and all its variants
- {{tilde}}
Image namespace
- {{Album Image}} — simple code, uses {{albumcover}}.
Deletion-process documentation
- {{afd bottom}}, {{afd top}}
- {{mfd top}}, {{mfd bottom}},
- {{mfd}}
Misc. templates
- {{afd}} doesn't work unless substituted
- {{debate top}}, {{debate bottom}} — similar bolderplate message as for the deletion related messages, but for regular discussions instead.
- {{nobr}} used to ensure that wikilinks don't break across lines
- {{prod}} doesn't work unless substituted, similar: {{nsd}}, {{nld}}.
- {{TFAfooter}} links relevant to current featured article, notably used on the main page.
- User signature templates cause undue server strain as changes to a minor user template must then be widely propagated.
- {{WP:RM}}, {{Move2}} simplify move requests.
Uncategorised suggestions
- Template:R from shortcut (edit talk links history watch) belongs technically to the article namespace
Templates that must be substituted
These templates have a purpose and/or syntax that require them to be substed.
- {{doctl}} — must be substituted in order to function; creates standard form on template talk page for manual editing.
- {{archivebox}} — subst magic. Creates a link box for archives.
- {{afd}} — or else the link to "this article's entry" doesn't work.
- {{conv-dist}} — Produces text converting an input distance to different units
- {{conv-temp}} — Produces text converting an input temperature to different units
Templates that should not be substituted
Generally, templates should not be substituted that
- (a) contain calls to ParserFunctions (#if, #switch, etc.) and
- (b) template calls that do leave some parameters to their defaults by not specifying them
because those constructs are not replaced in the generated wiki-code (Substing of case (a) leaves the #if or #switch constructs verbatim at the subst location and (b) leaves constructs like "{{{1|default value}}}").
List
This is a list of templates that should not be substituted. This is because they can either contain formatting standard code, contain complex code, or contain code that breaks if substituted.
- {{!}} escapes a vertical bar for Wiki table syntax from the default parameter and ParserFunctions mechanisms.
- {{main}} maintains formatting standard.
- {{ln}} {{lnt}} etc., complex code.
- the various {{stub}} templates for simplified usage and removal.
- {{See also}} — standard formatting for see also list.
- {{Signpost-subscription}} (must be updated weekly).
- {{if defined}}, {{unless defined}}, etc. are conditional templates; substituting would remove this feature resulting in a constant value.
- {{qif}}, {{switch}}, {{ifndef}} are also conditional templates; substituting breaks usage.
- {{booland}}, {{boolor}}, {{boolxor}}, {{boolnand}}, {{boolnor}}, {{boolnxor}}, {{boolnot}}, {{booleq}}, {{boolne}} — conditional template, complex code.
- various citation/reference templates (see WP:CITET) which contain very complex conditional code
- various infoboxes, which should look consistent on various pages.
- {{copyvio}} — far too much wikicode, and a bot relies upon it to populate WP:CP with unlisted articles.
- {{Javadoc:SE}}, {{Javadoc:EE}} and {{Javadoc:SE-guide}} — conditional templates whose purpose is to update the links when the master template is updated.
- {{wikilink}} — meant for special uses inside templates, does not work when subst'ed
- {{talkarchive}}, {{archive}}
- {{cleanup}}, {{wikify}}, {{merge}} and other cleanup templates — bots rely on them to sort into cleanup-by-month categories.
- {{cfd}}, {{cfdu}}, {{cfr}}, {{cfr-speedy}}, {{cfm}}, {{cfru}} — bots rely on them not being substituted so they can be automatically removed from category page source.
- {{SharedIP}} {{ISP}} {{AOL}} {{repeat vandal}} — not messages to the users (so it's no problem if they change from their original form), so no reason to subst, but the standard reasons not to subst apply.
Wrong title templates
These templates -- used in the main-space -- add a comment about why an article is misnamed. The categories for these templates are being removed because they create a self-reference. Once the categories are removed, The "What links here" tool can be used to find all transclusions of the template. They should not be subst'd, because it will remove this method of finding where it is used.
- {{lowercase}}
- {{underscore}}
- {{lowercase and underscore}}
- {{longtitle}}
- {{pipe in title}}
- {{namespace}}
- {{bracketed title}}
- {{pound}}
- {{no unicode character}}
- {{downsize}}
- {{wrongtitle}}
Chemical abbreviations
See Category:Chemical element symbol templates. These are used to simplify the entry of chemical formulae.
- {{Actinium}}, {{Aluminum}}, {{Americium}}, {{Antimony}}, {{Argon}}, {{Arsenic}}, {{Astatine}}
- {{Barium}}, {{Berkelium}}, {{Beryllium}}, {{Bismuth}}, {{Bohrium}}, {{Boron}}, {{Bromine}}
- {{Cadmium}}, {{Caesium}}, {{Calcium}}, {{Californium}}, {{Carbon}}, {{Cerium}}, {{Chlorine}}, {{Chromium}}, {{Cobalt}}, {{Copper}}, {{Curium}}
- {{Darmstadtium}}, {{Dubnium}}, {{Dysprosium}}
- {{Einsteinium}}, {{Erbium}}, {{Europium}}
- {{Fermium}}, {{Fluorine}}, {{Francium}}
- {{Gadolinium}}, {{Gallium}}, {{Germanium}}, {{Gold}}
- {{Hafnium}}, {{Hassium}}, {{Helium}}, {{Holmium}}, {{Hydrogen}}
- {{Indium}}, {{Iodine}}, {{Iridium}}, {{Iron}}
- {{Lanthanum}}, {{Lawrencium}}, {{Lead}}, {{Lithium}}, {{Lutetium}}
- {{Magnesium}}, {{Manganese}}, {{Meitnerium}}, {{Mendelevium}}, {{Mercury}}, {{Molybdenum}}
- {{Neodymium}}, {{Neon}}, {{Neptunium}}, {{Niobium}}, {{Nitrogen}}, {{Nobelium}}
- {{Osmium}}, {{Oxygen}}
- {{Palladium}}, {{Phosphorus}}, {{Platinum}}, {{Plutonium}}, {{Polonium}}, {{Potassium}}, {{Praseodymium}}, {{Promethium}}, {{Protactinium}}
- {{Radium}}, {{Radon}}, {{Rhenium}}, {{Rhodium}}, {{Roentgenium}}, {{Rubidium}}, {{Ruthenium}}, {{Rutherfordium}}
- {{Samarium}}, {{Scandium}}, {{Seaborgium}}, {{Selenium}}, {{Silicon}}, {{Silver}}, {{Sodium}}, {{Strontium}}, {{Sulfur}}
- {{Tantalum}}, {{Technetium}}, {{Tellurium}}, {{Terbium}}, {{Thallium}}, {{Thorium}}, {{Thulium}}, {{Tin}}, {{Titanium}}, {{Tungsten}}
- {{Ununbium}}, {{Ununhexium}}, {{Ununoctium}}, {{Ununpentium}}, {{Ununquadium}}, {{Ununseptium}}, {{Ununtrium}}, {{Uranium}}
- {{Vanadium}}
- {{Xenon}}
- {{Ytterbium}}, {{Yttrium}}
- {{Zinc}}, {{Zirconium}}
Deletion-related
Most templates related to renaming or deleting pages are used temporarily, and thus do not need to be substituted (it just makes more work to delete them).
- {{afd2}} {{afd3}}
- {{tfd2}} {{tfdnotice}} {{catfd}}
- {{ifd}} {{ifd2}} {{idw}} {{idw-uo}} {{idw-pui}} {{idw-cp}}
- {{cfd}} {{cfr}} {{cfm}} {{cfdnotice}}
- {{sfd-t}} {{sfd-r}} {{sfd-c}} {{sfr-t}} {{sfr-c}}
- and all in Category:Speedy_deletion_templates
- {{editprotected}} not deletion related, but also temporary
- Note: Exceptions are {{afd}}, {{nld}}, {{nsd}}, and {{prod}} (which do not work correctly unless substituted). In addition, those templates which document a finished deletion process ({{afd top}}, etc). should be substituted.
Standardised appearance templates
These templates are intended to standardise the appearance of pages across a system of pages, and should not be substituted as doing so would make it prohibitively labour-intensive to edit them.
Under debate
- {{moved}}, {{moved-n}}, . There are not that many articles on requested moves at one time, so there is little benefit, and it is easier for the admin to remove afterwards if the template has not been substituted, especially when there is other stuff near the template, especially other substituted templates.
- {{col-begin}} {{col-2}} {{col-3}} {{col-4}} {{col-end}} — alleged by some to simplify usage.
- {{clear}}, {{clearleft}} {{clearright}}
- {{ed}} {{ed2}} {{ed right}} {{edit}} — simplify addition of edit link to templates
- Some have suggested that since user sig templates should be substed, {{unsigned}}, {{unsigned2}} should be substed for the same reasons. However, the latter are all protected and will change much more infrequently than most signature templates; also, they're significantly longer.
- {{tl}} {{tlp}} {{ttl}} {{ti}} {{tic}} {{tls}} {{cl}} {{ccl}}: Many very widely used ({{tl}} with over 70,000 transclusions at last count). Quicker to type than their substitutions, and some advocate their non-substing so that new Wikipedians will learn about them and be able to use them.
See also
- Substitution documentation on Meta
- User:Pathoschild/Template substitution list (bot-parseable lists, last updated 12 September 2006)
- {{subst}} (A talkpage template that reminds users to subst)
- Substitution bots using this page