Difference between revisions of "Template:Correct title/doc"

From blackwiki
Jump to navigation Jump to search
imported>SD0001
(update and improve documentation)
imported>SD0001
(subst the templates as they dont produce correct output here, will modify output manually here for the documentation)
Line 11: Line 11:
 
:At [[Coffee 1]]:
 
:At [[Coffee 1]]:
 
:<code><nowiki>{{Correct title|Coffee #1|reason=#}}</nowiki></code>
 
:<code><nowiki>{{Correct title|Coffee #1|reason=#}}</nowiki></code>
{{Correct title|Coffee #1|reason=#}}
+
{{selfref|1=The correct title of this {{#if:{{NAMESPACE}}|page|article}} is '''Coffee #1'''. {{#switch:#
 +
|:|namespace = The substitution or omission of the [[Colon (punctuation)|colon]] is
 +
|(|bracket = The {{#switch:{{#expr: {{#invoke:String|len|Coffee #1}} - {{#invoke:String|len|{{#invoke:String|replace|{{PAGENAME}}| %(.*%)$||1|false}}}} }}
 +
|2 = omission
 +
|0 = substitution
 +
|#default = substitution or omission}} of any [[brackets]] is
 +
|#|hash|number = The {{#ifeq:{{#expr: {{#invoke:String|len|Coffee #1}} - {{#invoke:String|len|{{#invoke:String|replace|{{PAGENAME}}| %(.*%)$||1|false}}}} }}|1|omission|substitution}} of the [[number sign|#]] is
 +
|vbar|obelisk|vertical bar|pipe|verticalbar = The {{#ifeq:{{#expr: {{#invoke:String|len|Coffee #1}} - {{#invoke:String|len|{{#invoke:String|replace|{{PAGENAME}}| %(.*%)$||1|false}}}} }}|1|omission|substitution}} of the [[vertical bar]] is
 +
|#default = It appears incorrectly here
 +
}} due to [[Wikipedia:Naming conventions (technical restrictions)|technical restrictions]].}}{{#if:{{NAMESPACE}}{{#iferror:{{#invoke:Page|interwiki|Coffee #1}}{{#invoke:Page|fragment|Coffee #1a}}{{#ifeq:{{#invoke:Page|isContentPage|Coffee #1}}|true||a}}|a}}||[[Category:Pages using technically valid titles in correct title hatnotes]]}}
 +
{{Namespace detect
 +
| main  = [[Category:Restricted titles]]
 +
| draft = [[Category:Restricted titles]]
 +
| other = <!-- Don't categorize when not in main or draft space --> }}
  
 
:At [[The No.1s]]:
 
:At [[The No.1s]]:
 
:<code><nowiki>{{Correct title|The #1s|reason=#}}</nowiki></code>
 
:<code><nowiki>{{Correct title|The #1s|reason=#}}</nowiki></code>
{{Correct title|The #1s|reason=#}}
+
{{selfref|1=The correct title of this {{#if:{{NAMESPACE}}|page|article}} is '''The #1s'''. {{#switch:#
 +
|:|namespace = The substitution or omission of the [[Colon (punctuation)|colon]] is
 +
|(|bracket = The {{#switch:{{#expr: {{#invoke:String|len|The #1s}} - {{#invoke:String|len|{{#invoke:String|replace|{{PAGENAME}}| %(.*%)$||1|false}}}} }}
 +
|2 = omission
 +
|0 = substitution
 +
|#default = substitution or omission}} of any [[brackets]] is
 +
|#|hash|number = The {{#ifeq:{{#expr: {{#invoke:String|len|The #1s}} - {{#invoke:String|len|{{#invoke:String|replace|{{PAGENAME}}| %(.*%)$||1|false}}}} }}|1|omission|substitution}} of the [[number sign|#]] is
 +
|vbar|obelisk|vertical bar|pipe|verticalbar = The {{#ifeq:{{#expr: {{#invoke:String|len|The #1s}} - {{#invoke:String|len|{{#invoke:String|replace|{{PAGENAME}}| %(.*%)$||1|false}}}} }}|1|omission|substitution}} of the [[vertical bar]] is
 +
|#default = It appears incorrectly here
 +
}} due to [[Wikipedia:Naming conventions (technical restrictions)|technical restrictions]].}}{{#if:{{NAMESPACE}}{{#iferror:{{#invoke:Page|interwiki|The #1s}}{{#invoke:Page|fragment|The #1sa}}{{#ifeq:{{#invoke:Page|isContentPage|The #1s}}|true||a}}|a}}||[[Category:Pages using technically valid titles in correct title hatnotes]]}}
 +
{{Namespace detect
 +
| main  = [[Category:Restricted titles]]
 +
| draft = [[Category:Restricted titles]]
 +
| other = <!-- Don't categorize when not in main or draft space --> }}
  
 
For issues with any of ([[bracket|< > [ ] { }]]), pass the {{para|reason|bracket}} parameter. If the stored page title length is 2 less than the correct title provided to the template, the wording "omission" is produced. If both titles are of same length, the wording "substitution" is produced by default. If this is not correct for a particular page, add a <code>|edit=</code> parameter providing the correct wording.
 
For issues with any of ([[bracket|< > [ ] { }]]), pass the {{para|reason|bracket}} parameter. If the stored page title length is 2 less than the correct title provided to the template, the wording "omission" is produced. If both titles are of same length, the wording "substitution" is produced by default. If this is not correct for a particular page, add a <code>|edit=</code> parameter providing the correct wording.
 
:<code><nowiki>{{Correct title|Benzo[a]pyrene|reason=bracket}}</nowiki></code>
 
:<code><nowiki>{{Correct title|Benzo[a]pyrene|reason=bracket}}</nowiki></code>
{{Correct title|Benzo[a]pyrene|reason=bracket}}
+
{{selfref|1=The correct title of this {{#if:{{NAMESPACE}}|page|article}} is '''Benzo[a]pyrene'''. {{#switch:bracket
 +
|:|namespace = The substitution or omission of the [[Colon (punctuation)|colon]] is
 +
|(|bracket = The {{#switch:{{#expr: {{#invoke:String|len|Benzo[a]pyrene}} - {{#invoke:String|len|{{#invoke:String|replace|{{PAGENAME}}| %(.*%)$||1|false}}}} }}
 +
|2 = omission
 +
|0 = substitution
 +
|#default = substitution or omission}} of any [[brackets]] is
 +
|#|hash|number = The {{#ifeq:{{#expr: {{#invoke:String|len|Benzo[a]pyrene}} - {{#invoke:String|len|{{#invoke:String|replace|{{PAGENAME}}| %(.*%)$||1|false}}}} }}|1|omission|substitution}} of the [[number sign|#]] is
 +
|vbar|obelisk|vertical bar|pipe|verticalbar = The {{#ifeq:{{#expr: {{#invoke:String|len|Benzo[a]pyrene}} - {{#invoke:String|len|{{#invoke:String|replace|{{PAGENAME}}| %(.*%)$||1|false}}}} }}|1|omission|substitution}} of the [[vertical bar]] is
 +
|#default = It appears incorrectly here
 +
}} due to [[Wikipedia:Naming conventions (technical restrictions)|technical restrictions]].}}{{#if:{{NAMESPACE}}{{#iferror:{{#invoke:Page|interwiki|Benzo[a]pyrene}}{{#invoke:Page|fragment|Benzo[a]pyrenea}}{{#ifeq:{{#invoke:Page|isContentPage|Benzo[a]pyrene}}|true||a}}|a}}||[[Category:Pages using technically valid titles in correct title hatnotes]]}}
 +
{{Namespace detect
 +
| main  = [[Category:Restricted titles]]
 +
| draft = [[Category:Restricted titles]]
 +
| other = <!-- Don't categorize when not in main or draft space --> }}
  
  
Line 30: Line 69:
 
:At [[Europa – Fira station]]:
 
:At [[Europa – Fira station]]:
 
:<code><nowiki>{{Correct title|Europa {{!}} Fira station|reason=vbar}}</nowiki></code>
 
:<code><nowiki>{{Correct title|Europa {{!}} Fira station|reason=vbar}}</nowiki></code>
{{Correct title|Europa {{!}} Fira station|reason=:}}
+
{{selfref|1=The correct title of this {{#if:{{NAMESPACE}}|page|article}} is '''Europa {{!}} Fira station'''. {{#switch::
 +
|:|namespace = The substitution or omission of the [[Colon (punctuation)|colon]] is
 +
|(|bracket = The {{#switch:{{#expr: {{#invoke:String|len|Europa {{!}} Fira station}} - {{#invoke:String|len|{{#invoke:String|replace|{{PAGENAME}}| %(.*%)$||1|false}}}} }}
 +
|2 = omission
 +
|0 = substitution
 +
|#default = substitution or omission}} of any [[brackets]] is
 +
|#|hash|number = The {{#ifeq:{{#expr: {{#invoke:String|len|Europa {{!}} Fira station}} - {{#invoke:String|len|{{#invoke:String|replace|{{PAGENAME}}| %(.*%)$||1|false}}}} }}|1|omission|substitution}} of the [[number sign|#]] is
 +
|vbar|obelisk|vertical bar|pipe|verticalbar = The {{#ifeq:{{#expr: {{#invoke:String|len|Europa {{!}} Fira station}} - {{#invoke:String|len|{{#invoke:String|replace|{{PAGENAME}}| %(.*%)$||1|false}}}} }}|1|omission|substitution}} of the [[vertical bar]] is
 +
|#default = It appears incorrectly here
 +
}} due to [[Wikipedia:Naming conventions (technical restrictions)|technical restrictions]].}}{{#if:{{NAMESPACE}}{{#iferror:{{#invoke:Page|interwiki|Europa {{!}} Fira station}}{{#invoke:Page|fragment|Europa {{!}} Fira stationa}}{{#ifeq:{{#invoke:Page|isContentPage|Europa {{!}} Fira station}}|true||a}}|a}}||[[Category:Pages using technically valid titles in correct title hatnotes]]}}
 +
{{Namespace detect
 +
| main  = [[Category:Restricted titles]]
 +
| draft = [[Category:Restricted titles]]
 +
| other = <!-- Don't categorize when not in main or draft space --> }}
  
 
:At [[DE9 Transitions]]:
 
:At [[DE9 Transitions]]:
 
:<code><nowiki>{{Correct title|DE9 {{!}} Transitions|reason=vbar}}</nowiki></code>
 
:<code><nowiki>{{Correct title|DE9 {{!}} Transitions|reason=vbar}}</nowiki></code>
{{Correct title|DE9 {{!}} Transitions|reason=:}}
+
{{selfref|1=The correct title of this {{#if:{{NAMESPACE}}|page|article}} is '''DE9 {{!}} Transitions'''. {{#switch::
 +
|:|namespace = The substitution or omission of the [[Colon (punctuation)|colon]] is
 +
|(|bracket = The {{#switch:{{#expr: {{#invoke:String|len|DE9 {{!}} Transitions}} - {{#invoke:String|len|{{#invoke:String|replace|{{PAGENAME}}| %(.*%)$||1|false}}}} }}
 +
|2 = omission
 +
|0 = substitution
 +
|#default = substitution or omission}} of any [[brackets]] is
 +
|#|hash|number = The {{#ifeq:{{#expr: {{#invoke:String|len|DE9 {{!}} Transitions}} - {{#invoke:String|len|{{#invoke:String|replace|{{PAGENAME}}| %(.*%)$||1|false}}}} }}|1|omission|substitution}} of the [[number sign|#]] is
 +
|vbar|obelisk|vertical bar|pipe|verticalbar = The {{#ifeq:{{#expr: {{#invoke:String|len|DE9 {{!}} Transitions}} - {{#invoke:String|len|{{#invoke:String|replace|{{PAGENAME}}| %(.*%)$||1|false}}}} }}|1|omission|substitution}} of the [[vertical bar]] is
 +
|#default = It appears incorrectly here
 +
}} due to [[Wikipedia:Naming conventions (technical restrictions)|technical restrictions]].}}{{#if:{{NAMESPACE}}{{#iferror:{{#invoke:Page|interwiki|DE9 {{!}} Transitions}}{{#invoke:Page|fragment|DE9 {{!}} Transitionsa}}{{#ifeq:{{#invoke:Page|isContentPage|DE9 {{!}} Transitions}}|true||a}}|a}}||[[Category:Pages using technically valid titles in correct title hatnotes]]}}
 +
{{Namespace detect
 +
| main  = [[Category:Restricted titles]]
 +
| draft = [[Category:Restricted titles]]
 +
| other = <!-- Don't categorize when not in main or draft space --> }}
  
  

Revision as of 18:43, 20 November 2018

This is a Wikipedia maintenance template that produces an article hatnote to help explain to readers that restrictions on titles containing colons, periods, and some other characters (noted at Wikipedia:Naming conventions (technical restrictions)) affect the page name of the page they are reading.

The first unnamed parameter takes the correct name of the page. Do not include any disambiguation-resolving terms within brackets.

Examples

For issues with the (#) sign, pass the |reason=# parameter. If the stored page title length is 1 less than the correct title provided to the template, the wording "omission" is produced. Otherwise, the wording "substitution" is produced by default. If this is not correct for a particular page, add a |edit= parameter providing the correct wording.

At Coffee 1:
{{Correct title|Coffee #1|reason=#}}

Template:Namespace detect

At The No.1s:
{{Correct title|The #1s|reason=#}}

Template:Namespace detect

For issues with any of (< > [ ] { }), pass the |reason=bracket parameter. If the stored page title length is 2 less than the correct title provided to the template, the wording "omission" is produced. If both titles are of same length, the wording "substitution" is produced by default. If this is not correct for a particular page, add a |edit= parameter providing the correct wording.

{{Correct title|Benzo[a]pyrene|reason=bracket}}

Template:Namespace detect


For issues with :, pass the |reason=: parameter:

{{Correct title|DK: King of Swing|reason=:}}

Template:Namespace detect

For issues with |, pass the |reason=vbar parameter. Use Template:T instead of | while providing the correct title in the template (since | characters are not allowed in template parameters). If the stored page title length is 1 less than the correct title provided to the template, the wording "omission" is produced. Otherwise, the wording "substitution" is produced by default. If this is not correct for a particular page, add a |edit= parameter providing the correct wording.

At Europa – Fira station:
{{Correct title|Europa {{!}} Fira station|reason=vbar}}

Template:Namespace detect

At DE9 Transitions:
{{Correct title|DE9 {{!}} Transitions|reason=vbar}}

Template:Namespace detect


The template can also be used without a reason, which produces:

Template:Namespace detect

See also

Template:WrongTitleExamples