User:Rpclod/Patent Templates/Citation

This page is part of my attempt to understand how templates work and hopefully improve certain templates or their documentation. This page is a subset of my particular focus on patent citation templates.

As of 2008-11-26, the Citation template calls the  Citation/patent template using the following parameters:

In the absence of any other information, I assume the above is a complete list of the parameters for the Citation/patent template. The Citation template discussion page indicates that, when using the citation template to cite patents, inventor-last is the only required parameter.

As of 2008-11-26, the Citation/patent template begins with the following:



Don't look at my wikitext source for the above as I had to use some real kludges to make this appear the same as on the template's "view source" page. But if you do view my source and have any ideas how to display well-formatted code without hardcoding spaces, please let me know.

 is a start HTML tag. (The end tag is found later in the template.) The CITE tag typically contains the source name for subsequently referenced information. It does not have any required attributes. The first line of citation/patent code uses two optional attributes, style and id. These are common attributes that can be used in most HTML tags. (After HTML 2.0, the style attribute was deprecated, except as to inline, internal or external  style sheets.     However, I do not know the extent to which CSS is  implemented within Wikipedia.) The style attribute is used in the Citation/patent template as follows:

style="font-style:normal"

Typically browsers render text contained within the CITE tag in italics. I assume that the purpose of using the style attribute in this manner is to override the typical rendering and use normal, rather than italic, font. However, this begs the question of '''why the CITE tag is used in the first place. If the text appears normal, why not just transclude the text itself rather than embed it within a CITE tag?'  I am somewhat surprised that the title'' attribute is not used. It provides a short description of the element that is shown as a "tool tip" when the mouse hovers over the element.

Because the id attribute is embedded within a complex Wikimedia parser function structure, a discussion of the parser function structure will precede a discussion of the id attribute.

The structure begins with a two braces or curly brackets. The double brace directs Wikimedia to  transclude a template. The next item is an #if parser function which defines the transcluded content. #if is a parser function contained in the  ParserFunctions collection. The syntax for #if is:

The condition string for the outermost #if statement appears to be. The triple brace {{{ indicates a parameter that is passed to the template from its caller. Whence came "Ref"? It is not listed by the Citation template as a  parameter passed to the Citation/patent template. A ref template exists, but that would require a double brace, not a triple brace. Further a REF tag exists in HTML, but the angle brackets are missing. Also, why does the pipe character "|" immediately follow "Ref" (especially when more piping follows the closing curly brackets)? I assume that "Ref" is an undefined parameter without a default value.


 * 1)  ifeq is a  parser function contained in the  ParserFunctions collection.  The syntax for # ifeq is:

{{ #ifeq: | | | }}

The "id" attribute assigns an identifier to the associated element.

If the link points to the document in which the link is embedded, the link appears in bold and does not appear as a hyperlink.

The call to the Link template creates a link to the European Patent Office website at http://v3.espacenet.com.