Πρότυπο:Disambiguated

From protonation
Jump to navigation Jump to search


Template properties [edit]
Ontology: Upper ontology, MyMDb
Template: Movie
Template category: Templates with full error handling
Required extensions
{{
i
}} Template documentation [edit]


Parses disambiguated titles.

It can return 3 things:

  1. the title, or
  2. the contents inside the parenthesis, or
  3. a status report of whether this title is disambiguated or plain.

Usage

Example title Syntax Result
Foo (bar)
{{disambiguated|Foo (bar)}}
Foo
{{disambiguated|Foo (bar)|parenthesis}}
bar
{{disambiguated|Foo (bar)|check}}
disambiguated
Foo
{{disambiguated|Foo}}
Foo
{{disambiguated|Foo|parenthesis}}
{{disambiguated|Foo|check}}
plain
  • If 2nd parameter is anything but parenthesis or check is ignored.
  • If there is any error it returns the error.

Error handling examples

No parameters given

{{disambiguated}}

Template error: Parameter missing

Second parameter is not parenthesis or check

{{disambiguated|Foo|Bar}}

Foo

Title begins with parenthesis

{{disambiguated|(Foo)}}

Title error: Title cannot begin with opening parenthesis "("

There is more after the parenthesis

{{disambiguated|Foo (bar) bar}}

Title error: Title cannot end with anything other than closing parenthesis ")"

Parentheses reversed

{{disambiguated|Foo )bar(}}

Title error: Title cannot end with anything other than closing parenthesis ")"

No opening parenthesis

{{disambiguated|Foo bar)}}

Title error: Closing parenthesis ")" found but opening parenthesis "(" missing

One opening and two closing parentheses

{{disambiguated|Foo (bar))}}

Title error: Too many closing parentheses ")"

No closing parenthesis

{{disambiguated|Foo (bar}}

Title error: Opening parenthesis "(" found but closing parenthesis ")" missing

Two opening and one closing parentheses

{{disambiguated|Foo ((bar)}}

Title error: Too many opening parentheses "("