Template:Title: Difference between revisions

From Tolkien Gateway
m (More testing)
m (Usage instructions)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{DISPLAYTITLE:{{#if:{{NAMESPACE}}|{{NAMESPACE}}:}}{{#ifeq:{{#switch:{{{1}}} | italic = italic | italics = italic | journal = italic}}{{#switch:{{{2}}} | italic = italic | italics = italic | journal = italic}}|italic|''}}{{#ifeq:{{#switch:{{{1}}} | lowercase = lowercase | lower-case = lowercase | lower case = lowercase}}{{#switch:{{{2}}} | lowercase = lowercase | lower-case = lowercase | lower case = lowercase}}|lowercase|{{lcfirst:{{#explode:{{PAGENAME}}|(|0}}}}|{{#explode:{{PAGENAME}}|{{#ifeq:{{{1}}}|journal| |(}}|{{#ifeq:{{{1}}}|journal|-2|0}}}}}}{{#ifeq:{{#switch:{{{1}}} | italic = italic | italics = italic | journal = italic}}{{#switch:{{{2}}} | italic = italic | italics = italic | journal = italic}}|italic|''}} {{#ifeq:{{#sub:{{PAGENAME}}|-1}}|)|<span style="font-size:0.7em">({{#explode:{{PAGENAME}}|(|1}}</span>}}}}{{#ifeq:{{{1}}}|journal|{{#explode:{{PAGENAME}}| |-1}}}}</includeonly><noinclude>
<includeonly>{{DISPLAYTITLE:{{#if:{{NAMESPACE}}|{{NAMESPACE}}:}}{{#ifeq:{{#switch:{{{1}}} | italic = italic | italics = italic | journal = italic}}{{#switch:{{{2}}} | italic = italic | italics = italic | journal = italic}}|italic|''}}{{#ifeq:{{#switch:{{{1}}} | lowercase = lowercase | lower-case = lowercase | lower case = lowercase}}{{#switch:{{{2}}} | lowercase = lowercase | lower-case = lowercase | lower case = lowercase}}|lowercase|{{lcfirst:{{#ifeq:{{{1}}}|journal|{{#explode:{{PAGENAME}}| |-11}} {{#explode:{{PAGENAME}}| |-10}} {{#explode:{{PAGENAME}}| |-9}} {{#explode:{{PAGENAME}}| |-8}} {{#explode:{{PAGENAME}}| |-7}} {{#explode:{{PAGENAME}}| |-6}} {{#explode:{{PAGENAME}}| |-5}} {{#explode:{{PAGENAME}}| |-4}} {{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}}|{{#explode:{{PAGENAME}}|(|0}}}}}}|{{#ifeq:{{{1}}}|journal|{{#explode:{{PAGENAME}}| |-11}} {{#explode:{{PAGENAME}}| |-10}} {{#explode:{{PAGENAME}}| |-9}} {{#explode:{{PAGENAME}}| |-8}} {{#explode:{{PAGENAME}}| |-7}} {{#explode:{{PAGENAME}}| |-6}} {{#explode:{{PAGENAME}}| |-5}} {{#explode:{{PAGENAME}}| |-4}} {{#explode:{{PAGENAME}}| |-3}} {{#explode:{{PAGENAME}}| |-2}}|{{#explode:{{PAGENAME}}|(|0}}}}}}{{#ifeq:{{#switch:{{{1}}} | italic = italic | italics = italic | journal = italic}}{{#switch:{{{2}}} | italic = italic | italics = italic | journal = italic}}|italic|''}} {{#ifeq:{{#sub:{{PAGENAME}}|-1}}|)|<span style="font-size:0.7em">({{#explode:{{PAGENAME}}|(|1}}</span>}}{{#ifeq:{{{1}}}|journal|{{#explode:{{PAGENAME}}| |-1}}}}}}</includeonly><noinclude>
A template to italicise titles, make the first letter lowercase, and to make bracketed terms lowercase.
'''Template:Title''' is a template to italicise titles (for books, games, journals etc.), make the first letter lowercase (for elvish words), and to make bracketed terms lowercase (for disambiguated items).
__NOTOC__
===Small Brackets===
This template will ''always'' make brackets lowercase. If all you need to do is make brackets lowercase, put the template in by itself without parameters.
<pre>
<pre>
{{title}}
{{title}}
</pre>
For example:[[Anardil (King of Gondor)]].
===Italics===
If you want to make a title italic, use the "italics" parameter.
<pre>
{{title|italics}}
{{title|italics}}
</pre>
For example: [[The Silmarillion]] and [[The Hobbit (1977 film)]].
===Lowercase===
If you want to make the first letter of the title lowercase (because MediaWiki automatically capitalise the first letter of page titles), use the "lowercase" parameter. This can be combined with italics.
<pre>
{{title|lowercase}}
{{title|lowercase}}
{{title|italics|lowercase}}
{{title|italics|lowercase}}
</pre>
For example: [[Mírdain]] and [[Lalaith (word)]].
===Journals===
If you have a journal that you want to italicise, you can use the "journal" parameter. However, this can only be used with journals that are in the format "''Journal Name'' #". If the title includes brackets just use "italics" above (e.g. [[The Catholic Herald (18 September 1981)]]); if the title includes unbracketed dates or issue numbers do '''not''' use this template.
<pre>
{{title|journal}}
{{title|journal}}
</pre>
</pre>
For an example of this template in operation, see: .
For example: [[Christian History 78]].  
[[Category:Disambiguation and redirection templates]][[Category:Utility templates]]
[[Category:Disambiguation and redirection templates]][[Category:Utility templates]]
{{title|lowercase|italic}}
</noinclude>
</noinclude>

Latest revision as of 22:29, 19 October 2012

Template:Title is a template to italicise titles (for books, games, journals etc.), make the first letter lowercase (for elvish words), and to make bracketed terms lowercase (for disambiguated items).

Small Brackets

This template will always make brackets lowercase. If all you need to do is make brackets lowercase, put the template in by itself without parameters.

{{title}}

For example:Anardil (King of Gondor).

Italics

If you want to make a title italic, use the "italics" parameter.

{{title|italics}}

For example: The Silmarillion and The Hobbit (1977 film).

Lowercase

If you want to make the first letter of the title lowercase (because MediaWiki automatically capitalise the first letter of page titles), use the "lowercase" parameter. This can be combined with italics.

{{title|lowercase}}
{{title|italics|lowercase}}

For example: Mírdain and Lalaith (word).

Journals

If you have a journal that you want to italicise, you can use the "journal" parameter. However, this can only be used with journals that are in the format "Journal Name #". If the title includes brackets just use "italics" above (e.g. The Catholic Herald (18 September 1981)); if the title includes unbracketed dates or issue numbers do not use this template.

{{title|journal}}

For example: Christian History 78.