Difference between revisions of "Template:Title format"
(Created page with "{{#vardefine: str |{{#ifeq:{{{ignore|}}}|/|{{PAGENAME}}|{{SUBPAGENAME}}}}}}<!-- Subpage -->{{#ifeq:{{{ignore|}}}|()||{{#vardefine: str |{{Trim_suffix|{{#var:str}}}}}}}}<!-- Pa...") |
|||
Line 2: | Line 2: | ||
-->{{#ifeq:{{{ignore|}}}|()||{{#vardefine: str |{{Trim_suffix|{{#var:str}}}}}}}}<!-- Parentheses handling | -->{{#ifeq:{{{ignore|}}}|()||{{#vardefine: str |{{Trim_suffix|{{#var:str}}}}}}}}<!-- Parentheses handling | ||
-->{{#ifeq:{{{ignore|}}}|:||{{#vardefine: str |{{Trim_prefix|{{#var:str}}}}}}}}<!-- Colon handling | -->{{#ifeq:{{{ignore|}}}|:||{{#vardefine: str |{{Trim_prefix|{{#var:str}}}}}}}}<!-- Colon handling | ||
− | -->-{T|zh:{{#var:str}};zh-hant:-{zh-hant;zh-tw|{{#var:str}}}-;zh-hans:-{zh-hans;zh-cn|{{#var:str}}}-;}-<!-- Title replacement | + | -->-{{T|zh:{{#var:str}};zh-hant:-{zh-hant;zh-tw|{{#var:str}}}-;zh-hans:-{zh-hans;zh-cn|{{#var:str}}}-;}-<!-- Title replacement |
-->{{SafeCate|nsidExclude=2,3|Formatted page}}{{ac|{{#ifeq:{{#var:str}}|{{PAGENAME}}|Wrongly formatted page}}}}<noinclude>{{doc}}[[Category:Formatting templates]]</noinclude> | -->{{SafeCate|nsidExclude=2,3|Formatted page}}{{ac|{{#ifeq:{{#var:str}}|{{PAGENAME}}|Wrongly formatted page}}}}<noinclude>{{doc}}[[Category:Formatting templates]]</noinclude> |
Revision as of 16:15, 24 September 2021
-{{T|zh:Title format;zh-hant:-{zh-hant;zh-tw|Title format}-;zh-hans:-{zh-hans;zh-cn|Title format}-;}-
Introduction
This template is used to format the titles of some pages or subpages with disambiguation annotations.
There are mainly the following situations:
- oo(xx) → oo
- oo:xx → xx
- oo/xx → xx
- oo/xx/.../zz → zz
Not all ambiguous articles need to be formatted, please select according to actual needs.
Example usage
{{Title format}}
The effect is already produced on this page. (Originally titled "Template:Title format")
Use the parameter ignore to ignore a formatting rule:
- [ignore=/] Subpages are not processed
- [ignore=()] The parentheses at the end are not processed
- [ignore=:] The prefix colon is not processed
Warnings
- Non-user pages that use this template will add the hidden category: Category:Title formatted page.
- Pages whose titles do not need to be formatted are automatically generated using this template: Category:Wrongly formatted page.