Welcome to the Command & Conquer Wiki! Log in and join the community.

Hi Gamepedia users and contributors! Please complete this survey to help us learn how to better meet your needs in the future. We have one for editors and readers. This should only take about 7 minutes!

Template:Get disambiguation

From Command & Conquer Wiki
Jump to: navigation, search


Template documentation (for the template shown above, sometimes hidden or invisible)

This returns the article disambiguation of a disambiguated page's name. E.g.

{{Get disambiguation|Iron Curtain (Red Alert 1)}}

returns "Red Alert 1"

{{Get disambiguation|Iron Curtain}}

returns ""

Useful with {{PAGENAME}}.


{{Get disambiguation|Iron Curtain ((a))}}

returns "a"

Useful with {{PAGENAME}}.


You may also use "D" instead of "Get disambiguation"

{{D|Iron Curtain (Red Alert 1)}}

returns "Red Alert 1"

Implementation:

  • First check that there is at least one open bracket character
    • If not then return ""
    • otherwise continue...
  • Check that there is at least one close bracket character after the LAST open bracket character
    • If not then return ""
    • otherwise continue...
  • Check that there is nothing after the LAST close bracket character
    • If yes then return ""
    • otherwise continue...
  • Take everything after the LAST open bracket character
  • Out of that, take everything before the FIRST close bracket character
  • Return this string

See Also[edit source]


Debugging Info[edit source]

{{Get disambiguation|Iron Curtain (Red Alert 1) (Red Alert 2)}}

returns "Red Alert 2"

{{Get disambiguation|(Red Alert 1)}}

returns "Red Alert 1"

{{Get disambiguation|Iron Curtain (Red Alert 1))}}

returns "Red Alert 1"

{{Get disambiguation|Iron Curtain ((Red Alert 1)}}

returns "Red Alert 1"

{{Get disambiguation|Iron Curtain ((Red Alert 1))}}

returns "Red Alert 1"

{{Get disambiguation|Iron Curtain ()Red Alert 1()}}

returns ""

{{Get disambiguation|Iron Curtain ()Red Alert 1(}}

returns ""

{{Get disambiguation|Iron Curtain ()Red Alert 1)}}

returns ""


Documentation transcluded from Template:Get disambiguation/doc.