Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Examples  





2 Introduction  





3 Description  





4 Instructions  





5 Tracking categories  





6 See also  














Template:DISPLAYTITLE/doc







Add links
 









Template
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 

< Template:DISPLAYTITLE

Template:DISPLAYTITLE is a behaviour switch for MediaWiki code. Use {{DISPLAYTITLE:}} to format the title of an article without changing the address of the page. All or part of a page title can be shown in italics, with subscript and superscript, or any formatting required by article guidelines.

Examples[edit]

Actual title Displayed title Variable
Lorem ipsum dolor Lorem ipsum dolor {{DISPLAYTITLE:Lorem ''ipsum'' doLor}} Invalid; does not match title.
Lorem ipsum dolor Lorem ipsum dolor {{DISPLAYTITLE:Lorem ''ipsum'' dolor}}
Lorem ipsum dolor Lorem ipsum dolor {{DISPLAYTITLE:Lorem ipsum <sup>dolor</sup>}}
Lorem ipsum dolor Lorem ipsum dolor {{DISPLAYTITLE:Lorem <span style="position:absolute; top:-9999px;">ipsum</span> dolor}}
Lorem ipsum dolor Lorem ipsum dolor {{DISPLAYTITLE:Lorem <span style="color:#9400D3;">ipsum</span> dolor}}
Lorem ipsum dolor Lorem ipsum dolor {{DISPLAYTITLE:Lorem <span style="color:#9400D3;">ipsum</span> <span style="color:#F4A460;">dolor</span>}}
Portal:Lorem ipsum dolor : _ Portal _ _ : _ Lorem ipsum dolor {{DISPLAYTITLE:: _ Portal _ _ : _ Lorem ipsum dolor}}

Introduction[edit]

The title of a page name can always be copied and pasted to affect links, inclusions, and categories. DISPLAYTITLE enforces this, so then only changes that will convert to canonical form (standard format) will actually change the displayed title. It is possible to preview the changed title while on the edit page. One invalid change, such as the capitalization of a pagename letter after the first letter will invalidate any other allowed changes, and the whole title will display unchanged.

The title of a named page is the fullpagename, denoted "namespace:pagename". The namespace of an article is nameless, so it does not display, and the fullpagename is pagename.

It is important to note the warning sign at the top of this page preferring that the template form of DISPLAYTITLE not be used, but that rather the magic variable form of {{DISPLAYTITLE:}} be used directly as documented next. The template would simply call the magic word "DISPLAYTITLE:" anyway, so using template DISPLAYTITLE creates an (acceptable but) unnecessary step in page processing.

Magic variables use colon ":" but templates use bar/pipe "|" as the separator to indicate the page name to process here. Use the magic variable. If "|" is used instead of ":", it places the page in Category:Pages which use a template in place of a magic word, which may cause distractions.

Description[edit]

The title (the fullpagename) is changed using {{DISPLAYTITLE:namespace:pagename}} anywhere in the wikitext. As usual in markup, multiple spaces are made singular. The allowed visual changes are simply:

These possibilities exist because of the definition of a page name, which allows for the canonicalization of any title by copying and pasting the title into links, inclusions, and category names.

If there is more than one instance of DISPLAYTITLE in the wikitext, the last one overrides the previous ones. This means that if the DISPLAYTITLE automatically generated by something like some bookbox template needs to be overridden, then an explicit DISPLAYTITLE must be placed after that template to make your version display. If all efforts to change the title (with canonicalization compliance) fail, try looking at the bottom of the page for some stray magic variable DISPLAYTITLE.

Instructions[edit]

Template DISPLAYTITLE has the same instructions as magic variable DISPLAYTITLE. Please use ":" instead of "|".

  1. Type {{DISPLAYTITLE: anywhere in the wikitext.
  2. Type the wikitext for the fullpagename after that last ":" character. (See the description above.)
  3. After that changed title type the closing "}}". (See the examples above.)
  4. Preview the page and check the results.

If there is more than one instance of DISPLAYTITLE and they do not all specify the same title, only the last instance is enacted with an error message generated. For example:

Warning: Display title "<i>Desired title</i>" overrides earlier display title "<i>Desired</i> title".

The preferred solution to this problem is to remove or disable one of the instances of DISPLAYTITLE. If this is not possible due to template limitations, etc., then the error message may be suppressed by using the "noerror" parameter, i.e. {{DISPLAYTITLE:Desired Title|noerror}}. If you use this technique, you should be aware that the last instance of DISPLAYTITLE overrides the previous ones. This means that if the DISPLAYTITLE automatically generated by an infobox template needs to be overridden, then an explicit DISPLAYTITLE must be placed after the infobox to make it work.

Tracking categories[edit]

See also[edit]

Title changing or correcting templates + magic word
  • talk
  • edit
  • Wiki markup
    Transclusion from template:
    Involves Correct name Actual article name
    {{Italic title}} Title in italics To Kill a Mockingbird To Kill a Mockingbird
    {{Italic title|all=yes}} Complete title in italics, including parentheses Randall and Hopkirk (Deceased) Randall and Hopkirk (Deceased)
    {{Italic title|string=Ally McBeal}} Phrase of |string= in italics List of Ally McBeal episodes List of Ally McBeal episodes
    {{Italic title|all=yes|string=Fringe}} Phrase of |string= in italics; also looks in parentheses Peter (Fringe episode) Peter (Fringe episode)
    {{Italic disambiguation}} Disambiguation in italics The End (Lost) The End (Lost)
    {{Lowercase title}} Lowercase first character eBay EBay
    {{Lowercase title|italic=yes}} Lowercase first character and place title in italics, not including disambiguation iCarly (soundtrack) ICarly (soundtrack)
    {{Lowercase title|italic=yes|force=yes}} Lowercase first character and place title in italics, including disambiguation
    {{Lowercase title|dab=yes}} Lowercase first character and place disambiguation in italics iSpy (Modern Family) ISpy (Modern Family)
    {{Italic title prefixed|17}} Italicize after the number characters at the beginning of the title German battleship Bismarck German battleship Bismarck
    Magic word
    {{DISPLAYTITLE:_NSAKEY}} Various _NSAKEY NSAKEY
    Title corrections
    {{Correct title|reason=bracket}} < > [ ] { } Benzo[a]pyrene Benzo(a)pyrene
    {{Correct title|reason=#}} # Pilot #5 Pilot No. 5
    {{Correct title|reason=:}} : DK: King of Swing DK King of Swing



    Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:DISPLAYTITLE/doc&oldid=1230543426"

    Hidden category: 
    Template documentation pages
     



    This page was last edited on 23 June 2024, at 09:56 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki