Template:Title/doc: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
m (dab)
m (Robot: Cosmetic changes)
Line 1: Line 1:
'''{{tl|title}}''' is for the manipulation of page titles.  For instance, if I wanted to change this page's title from {{PAGENAME}} to something else, I could use {{tl|title}} to do that.  It is principally used to ''italicise'' story titles (like ''[[The Masque of Mandragora]]''), or of things that would normally get italics in common written English (ship names, some works of art, book names, periodical titles, and the like).  Guidance on what should and should not be italicised by be obtained at [[Tardis:Manual of Style|our manual of style]].
'''{{tl|title}}''' is for the manipulation of page titles.  For instance, if I wanted to change this page's title from {{PAGENAME}} to something else, I could use {{tl|title}} to do that.  It is principally used to ''italicise'' story titles (like ''[[The Masque of Mandragora]]''), or of things that would normally get italics in common written English (ship names, some works of art, book names, periodical titles, and the like).  Guidance on what should and should not be italicised by be obtained at [[Tardis:Manual of Style|our manual of style]].


==Usage examples==
== Usage examples ==
Let's look at some practical usages first, and then discuss what might be some implications of these usages.
Let's look at some practical usages first, and then discuss what might be some implications of these usages.
*<code><nowiki>{{Title}}</nowiki></code> ''removes namespace''
* <code><nowiki>{{Title}}</nowiki></code> ''removes namespace''
*<code><nowiki>{{Title|Foo Bar}}</nowiki></code> ''custom title
* <code><nowiki>{{Title|Foo Bar}}</nowiki></code> ''custom title
*<code><nowiki>{{Title|align=center}}</nowiki></code> ''centered''
* <code><nowiki>{{Title|align=center}}</nowiki></code> ''centered''
*<code><nowiki>{{Title|align=right}}</nowiki></code> ''aligned to the right''
* <code><nowiki>{{Title|align=right}}</nowiki></code> ''aligned to the right''
*<code><nowiki>{{Title|Foo Bar|align=center}}</nowiki></code> ''etc''
* <code><nowiki>{{Title|Foo Bar|align=center}}</nowiki></code> ''etc''


Note how free-form the template is.  You could literally change the title into whatever you wanted it to be.  Of course, this template doesn't ''actually'' change the title; it only changes the way it ''looks''.  So if you changed this page to '''Foo Bar''' it would still be '''{{FULLPAGENAME}}'''.  Thus, trying to link to the changed title wouldn't work:  [[Foo Bar]] means nothing to the wiki software.  
Note how free-form the template is.  You could literally change the title into whatever you wanted it to be.  Of course, this template doesn't ''actually'' change the title; it only changes the way it ''looks''.  So if you changed this page to '''Foo Bar''' it would still be '''{{FULLPAGENAME}}'''.  Thus, trying to link to the changed title wouldn't work:  [[Foo Bar]] means nothing to the wiki software.  


Though the freedom of being able to call a page anything has its drawbacks — it could be abused, or the editor might make a typo — its advantages far outstrip them.  Without the freedom to manipulate the title at will, it wouldn't be possible to ''partially'' italicise a title, as is useful in the following examples:
Though the freedom of being able to call a page anything has its drawbacks — it could be abused, or the editor might make a typo — its advantages far outstrip them.  Without the freedom to manipulate the title at will, it wouldn't be possible to ''partially'' italicise a title, as is useful in the following examples:
*[[Doctor Who universe|''Doctor Who'' universe]]
* [[Doctor Who universe|''Doctor Who'' universe]]
*[[The Sarah Jane Adventures novelisations|''The Sarah Jane Adventures'' novelisations]]
* [[The Sarah Jane Adventures novelisations|''The Sarah Jane Adventures'' novelisations]]
*[[Castrovalva (TV story)|''Castrovalva'' (TV story)]]
* [[Castrovalva (TV story)|''Castrovalva'' (TV story)]]
    
    
Obviously, we should be italicising every instance of the name of one of the four main programmes we cover: ''[[Torchwood (TV series)|Torchwood]]'', ''[[K9 (TV series)|K9]]'', ''[[Doctor Who]]'', and ''[[The Sarah Jane Adventures]]''.  This template allows us to do that, no matter the circumstance.  But it also allows us great flexibility with disambiguated names.
Obviously, we should be italicising every instance of the name of one of the four main programmes we cover: ''[[Torchwood (TV series)|Torchwood]]'', ''[[K9 (TV series)|K9]]'', ''[[Doctor Who]]'', and ''[[The Sarah Jane Adventures]]''.  This template allows us to do that, no matter the circumstance.  But it also allows us great flexibility with disambiguated names.
==General implementation compared to disambiguated usage==
== General implementation compared to disambiguated usage ==
Note that most of time the preferred syntax for this template is fairly simple:
Note that most of time the preferred syntax for this template is fairly simple:
<pre>{{title|''{{PAGENAME}}''}}</pre>
<pre>{{title|''{{PAGENAME}}''}}</pre>
By using the PAGENAME [[help:magic word|magic word]], we don't have to do any work at all.  Put that onto any page and it'll ''automatically'' italicise the title.
By using the PAGENAME [[Help:magic word|magic word]], we don't have to do any work at all.  Put that onto any page and it'll ''automatically'' italicise the title.


However, if you were to put that onto, say, [[Castrovalva (TV story)]] then it would render the slightly unsatisfying, ''[[Castrovalva (TV story)]]''.  What we want is something that italicises the name of the [[serial]], but leaves the disambiguation — that is, the '''(TV story)''' bit — alone.  We could laboriously type out:
However, if you were to put that onto, say, [[Castrovalva (TV story)]] then it would render the slightly unsatisfying, ''[[Castrovalva (TV story)]]''.  What we want is something that italicises the name of the [[serial]], but leaves the disambiguation — that is, the '''(TV story)''' bit — alone.  We could laboriously type out:
Line 31: Line 31:
<pre>{{title|''{{#sub:{{PAGENAME}}|(|-7}}'' (novel)}}</pre>
<pre>{{title|''{{#sub:{{PAGENAME}}|(|-7}}'' (novel)}}</pre>
Just change the negative number by as many digits as there are between and including the parentheses, and then add the disambiguation expression after the closing italic marks.
Just change the negative number by as many digits as there are between and including the parentheses, and then add the disambiguation expression after the closing italic marks.
==As compared with DISPLAYTITLE==
== As compared with DISPLAYTITLE ==
DISPLAYTITLE is a magic word whose programming has been greatly enhanced as of [[January]] [[2011]], or MediaWiki version 1.16.1.  It, too, can be used to italicize titles.  However, as of 1.16.1, this expression does not parse well for users who are not logged in.  Thus, we have chosen to implement the javascript-powered solution of {{tl|title}}, and once it's on the page, there's little likelihood that it will be replaced, even if and when MediaWiki fully implements DISPLAYTITLE to the standard of {{tl|title}}.   
DISPLAYTITLE is a magic word whose programming has been greatly enhanced as of [[January]] [[2011]], or MediaWiki version 1.16.1.  It, too, can be used to italicize titles.  However, as of 1.16.1, this expression does not parse well for users who are not logged in.  Thus, we have chosen to implement the javascript-powered solution of {{tl|title}}, and once it's on the page, there's little likelihood that it will be replaced, even if and when MediaWiki fully implements DISPLAYTITLE to the standard of {{tl|title}}.   


'''Please do not use DISPLAYTITLE on this wiki, as it will make subsequent changes harder if some pages are using DISPLAYTITLE and some are using {{tl|title}}.'''
'''Please do not use DISPLAYTITLE on this wiki, as it will make subsequent changes harder if some pages are using DISPLAYTITLE and some are using {{tl|title}}.'''

Revision as of 23:54, 30 January 2012

{{title}} is for the manipulation of page titles. For instance, if I wanted to change this page's title from Title/doc to something else, I could use {{title}} to do that. It is principally used to italicise story titles (like The Masque of Mandragora), or of things that would normally get italics in common written English (ship names, some works of art, book names, periodical titles, and the like). Guidance on what should and should not be italicised by be obtained at our manual of style.

Usage examples

Let's look at some practical usages first, and then discuss what might be some implications of these usages.

  • {{Title}} removes namespace
  • {{Title|Foo Bar}} custom title
  • {{Title|align=center}} centered
  • {{Title|align=right}} aligned to the right
  • {{Title|Foo Bar|align=center}} etc

Note how free-form the template is. You could literally change the title into whatever you wanted it to be. Of course, this template doesn't actually change the title; it only changes the way it looks. So if you changed this page to Foo Bar it would still be Template:Title/doc. Thus, trying to link to the changed title wouldn't work: Foo Bar means nothing to the wiki software.

Though the freedom of being able to call a page anything has its drawbacks — it could be abused, or the editor might make a typo — its advantages far outstrip them. Without the freedom to manipulate the title at will, it wouldn't be possible to partially italicise a title, as is useful in the following examples:

Obviously, we should be italicising every instance of the name of one of the four main programmes we cover: Torchwood, K9, Doctor Who, and The Sarah Jane Adventures. This template allows us to do that, no matter the circumstance. But it also allows us great flexibility with disambiguated names.

General implementation compared to disambiguated usage

Note that most of time the preferred syntax for this template is fairly simple:

{{title|''{{PAGENAME}}''}}

By using the PAGENAME magic word, we don't have to do any work at all. Put that onto any page and it'll automatically italicise the title.

However, if you were to put that onto, say, Castrovalva (TV story) then it would render the slightly unsatisfying, Castrovalva (TV story). What we want is something that italicises the name of the serial, but leaves the disambiguation — that is, the (TV story) bit — alone. We could laboriously type out:

{{title|''Castrovalva'' (TV story)}}

but the problem is that would only work on the Castrovalva page. If we want something that will work on more than that page, we can use something slightly more automated:

{{title|''{{#sub:{{PAGENAME}}|(|-10}}'' (TV story)}}

What this does is to "lop off" the last 10 characters from the page name (hence the -10) and then we stick on a new ten letters, (TV story) without italics. There's undoubtedly code which would allow you to lop off whatever was in parentheses, however long, but we don't have enough pages here to really warrant looking into something more automated. You can just use the above, and adapt it for each class of disambiguation. For instance, if we wanted to use it on comic stories, we'd write:

{{title|''{{#sub:{{PAGENAME}}|(|-13}}'' (comic story)}}

or if we wanted it on novels, we'd write:

{{title|''{{#sub:{{PAGENAME}}|(|-7}}'' (novel)}}

Just change the negative number by as many digits as there are between and including the parentheses, and then add the disambiguation expression after the closing italic marks.

As compared with DISPLAYTITLE

DISPLAYTITLE is a magic word whose programming has been greatly enhanced as of January 2011, or MediaWiki version 1.16.1. It, too, can be used to italicize titles. However, as of 1.16.1, this expression does not parse well for users who are not logged in. Thus, we have chosen to implement the javascript-powered solution of {{title}}, and once it's on the page, there's little likelihood that it will be replaced, even if and when MediaWiki fully implements DISPLAYTITLE to the standard of {{title}}.

Please do not use DISPLAYTITLE on this wiki, as it will make subsequent changes harder if some pages are using DISPLAYTITLE and some are using {{title}}.