模板:FULLPAGENAME/doc

来自决策链云智库
< 模板:FULLPAGENAME
Zeroclanzhang讨论 | 贡献2024年1月18日 (四) 14:46的版本 (创建页面,内容为“{{Documentation subpage}} <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see Wikipedia:Wikidata) --> == Usage == {{important|Please use '''<nowiki>{{FULLPAGENAME:page name}}</nowiki>''' rather than <nowiki>{{FULLPAGENAME|page name}}</nowiki>, with a colon (":"), not a pipe symbol ("|"). This uses the magic word directly instead of using the template to call the magic word.}} <nowik…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

Usage

模板:Important

{{FULLPAGENAME}} is not actually a template but instead a magic word, meaning it is a feature of the Wikimedia software. When used, it will return the name of the page it's on, including the namespace. As an example, when placed on this page, it returns 模板:FULLPAGENAME/doc. When placed on Wikipedia:Village pump, it will return . It is possible to specify which pagename will appear by using a colon (not a pipe as is typical for templates). As an example, {{FULLPAGENAME:Wikipedia:Village pump}} returns .

There is actual template code here. The purpose of the template code is to ensure that if someone uses this magic word with a piped parameter, the template code will be invoked and it will not cause an error on the page. Parameter 1 will be used as the : parameter and other parameters will be discarded. This way, if someone mistakenly enters {{FULLPAGENAME|Wikipedia:Village pump}}, the template will change it to the correct {{FULLPAGENAME:Wikipedia:Village pump}}.

When a user mistakenly includes a pipe in a {{FULLPAGENAME}} call, the template code will add the page to the hidden category Category:Pages which use a template in place of a magic word. Pages in this category should be fixed by willing editors.

Tracking category

See also