Template:Format title: Difference between revisions

From NPOWiki
Jump to navigation Jump to search
(create)
 
No edit summary
Line 25: Line 25:
       |{{#if:
       |{{#if:
         {{#pos:{{{1}}}|_}}
         {{#pos:{{{1}}}|_}}
         |{{lcfirst:{{#replace:{{PAGENAME}}|{{#replace:{{{1}}}|_|<nowiki> </nowiki>}}|{{{1}}}}}}}
         |{{lcfirst:{{#replace:{{PAGENAME}}|{{#replace:{{{1}}}|_|<nowiki/> <nowiki/>}}|{{{1}}}}}}}
         |{{lcfirst:{{PAGENAME}}}}
         |{{lcfirst:{{PAGENAME}}}}
       }}
       }}
       |{{#replace:{{PAGENAME}}|{{#replace:{{{1}}}|_|<nowiki> </nowiki>}}|{{{1}}}}}
       |{{#replace:{{PAGENAME}}|{{#replace:{{{1}}}|_|<nowiki/> <nowiki/>}}|{{{1}}}}}
     }}|noerror|noreplace
     }}|noerror|noreplace
   }}
   }}

Revision as of 13:42, 20 July 2020

Documentation [edit]

This template is used to automatically correct the display of page titles that are incorrectly formatted by the wiki software:
  • First letter should be lowercase
  • Some or all spaces should be underscores

There is only one parameter, which is unnamed and required: the correct formatting to use. Note that this must be the same as the name that occurs in the page title, except for the above corrections.

This template should only be used by other templates, as it suppresses any errors. It is included in most infoboxes.

Common usage: {{Format title|{{#if:{{{name|}}}|{{{name}}}|{{PAGENAME}}}}}}

See mw:Help:Magic words#DISPLAYTITLE for more information on how to do this manually when needed.

The above documentation is transcluded from Template:Format title/doc.