GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Main page
  • Get MediaWiki
  • Get extensions
  • Tech blog
  • Contribute
  • User help
  • FAQ
  • Technical manual
  • Support desk
  • Communication
  • Developer portal
  • Code statistics
  • Community portal
  • Recent changes

This view

  • Original page
  • New address

GeezerVison is showing www.mediawiki.org — Display title - MediaWiki

A display title is the preferred title associated with a wiki page. It typically provides the string of text that is shown in the title header of a page. It is conceptually and technically distinct from the page title , i.e. the title by which a page is recorded and made accessible over the web. By default, a display title is synonymous with the page title but can be customised to suit your needs.

Different wikis use different naming conventions for the page title and display title. For instance, the convention on a site like Wikipedia is that the page title of an article should be descriptive of the subject, while the display title may be customised only to take on some formatting that page titles don't support (lowercase initial, italics, superscript). Other wikis may prefer to use short, hash-generated page titles and leave the descriptive part to the display title only. Either approach is possible.

MediaWiki core

For users and site admins

  • The display title is usually visible as the title header of a page. A more reliable method of checking it, however, is by looking at the summary table that is usually known as Page information .
  • Unless the option $wgAllowDisplayTitle is set to false, the magic word DISPLAYTITLE lets you set a custom display title for a page. To an extent, it allows for HTML formatting options such as italics.
    • In addition, the main page's display title can be overridden with the Mainpage-title/Mainpage-title-loggedin system messages , described at Manual:Main Page .

Configuration settings:

Name Type Description Default
$wgAllowDisplayTitle boolean whether or not custom display titles are allowed to be set using DISPLAYTITLE. true
$wgRestrictDisplayTitle boolean whether or not customisation should be restricted to formatting. true

For developers

  • The display title is stored in rows of the page_props table where pp_propname equals 'displaytitle'. Its value is stored in pp_value.
  • It can be retrieved in PHP. See e.g.
    • PageProps::getProperties() - PageProps can be called using MediaWikiServices . Example:
      $title = Title::newFromText( "My smashing wiki page" );
      $displayTitleProps = MediaWikiServices::getInstance()->getPageProps()->getProperties( $title, "displaytitle" );
      $displayTitle = $displayTitleProps[$title->getArticleID()];
      
    • The ParserOutput class offers the methods getDisplayTitle() and getPageProperties().
  • It can be set in the ParserOutput using setDisplayTitle() or setPageProperty().
  • It can be retrieved over the API. See e.g.
    • API:Pageprops

Page links

Being able to store a custom display title does not automatically mean it is shown in page links (e.g. [[Mypagehere]]). This is usually achieved by installing the DisplayTitle extension. If a dependency on this extension happens to be undesirable, extensions could similarly use the HtmlPageLinkRendererBegin hook.

Extensions

  • Extension:DisplayTitle - builds on the use of the magic word DISPLAYTITLE by making sure that a wiki link to a page uses the display title as the default link text. It also provides a parser function to query a page's display title as well as an equivalent function for use in Lua.
  • Extension:PageProperties - lets you edit the display title and other page properties with the aid of a form
  • Extension:Semantic MediaWiki - builds on DISPLAYTITLE by automatically assigning the display title to a special property called "Display title of". See https://www.semantic-mediawiki.org/wiki/Help:Display_title
Retrieved from "https://www.mediawiki.org/w/index.php?title=Display_title&oldid=8695032"
Category:
  • MediaWiki concepts
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.