User:Droll/Citation templates

From Wikipedia, the free encyclopedia

In response to an editor's question I've written this to try to explain the way two kinds of citations templates work.

First take a look here to see the code for the template {{cite gnis}}. The code might look a bit strange but you will notice that it transcludes (i.e. uses) {{cite web}}. Cite gnis is actually is a sort of typing aid. It just fills in the data for cite web. So:

{{cite gnis|1143711|Mount Hood}}

produces the same output as:

{{cite web|url=http://geonames.usgs.gov/pls/gnispublic/f?p=gnispq:3:6277976307892308::NO::P3_FID:1143711|title=Mount Hood|publisher=[[Geographic Names Information System]]. [[United States Geological Survey|U.S. Geological Survey]]}}

If your look here your can will see the source for {{cite web}} and you will notice that cite web in turn transcludes {{Citation/core}}. There are a lot of templates that work this way. For example {{Infobox album}} transcludes {{Infobox}}.

The term "front-end", in this context, is sometimes used to refer to templates that use other templates, and so cite gnis is said to be a front-end for cite web or it might be said that cite web acts as a back-end for cite gnis.

A template redirect works much the same way as a article redirect. For example, if you look here you will see that {{citeweb}} redirects to {{cite web}}. If someone makes a mistake and types citeweb when they meant to type cite web, it still works. It is analogous to the way web site redirects to website.

The template {{GNIS}} is not a front-end or a redirect. It is hard coded and uses the external link syntax. It too is sort of typing aid. It just fills in the data to create an external link. So:

{{GNIS|1143711|Mount Hood}}

produces the same output as:

[http://geonames.usgs.gov/pls/gnispublic/f?p=gnispq:3:::NO::P3_FID:1143711 U.S. Geological Survey Geographical Names Information System:Mount Hood]

The template {{GNIS}} was and was created on 5 February 2007 and is currently transcluded in 11219 articles. {{Cite gnis}} was created on 23 April 2008 and is currently transcluded in 4605 articles. They have existed together ever since. There are several differences as is noted above. They use different syntax and produce output that is formatted differently. Also cite gnis requires the user to specify the feature name and traps errors. They each represent a different editor philosophy. There are several different schools of thought. One group I have noted objects to the use of any citation templates. Some object to the output format generated by the major citation templates such as {{cite web}}, {{cite book}}, {{cite journal}}, etc. All these transclude {{Citation/core}}.

Disclaimer: I help maintain cite gnis.

If you have additional questions please feel free to leave a note on my discussion page.