Template:Title disambig text/doc

From WikiAlpha
< Template:Title disambig text
Revision as of 03:02, 27 March 2017 by LuisAnton (Talk | contribs) (Created page with "{{Documentation subpage}} {{lua|Module:String}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> === Usage === : <code>{{Tlx|Title disambig text|''Tit...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Usage

{{Title disambig text|Title (disambig)}}

If page title is of the form Title (disambig), this function will return disambig. If no parenthetical expression is present, returns an empty string.

Write this to use the current page as title:

{{Title disambig text|{{PAGENAME}}}}

Examples

  • {{Title disambig text|Title (whatever)}} → {{#invoke:String|match|Title (whatever)|%s%((.-)%)||-1|ignore_errors=true}}
  • {{Title disambig text|[[Title (whatever)]]}} → {{#invoke:String|match|Title (whatever)|%s%((.-)%)||-1|ignore_errors=true}}

See also

Template:String-handling templates