模板:If pagename/doc查看源代码查看历史
本文档是Template:If pagename的文档子页面(见模板页自身)。 本页包含用法信息、分类和其他非原模板页面的内容。 |
40px | 此模板在530,000个页面+中使用。 为了避免困扰和不必要的服务器负载,所有变更都应该经过测试。请先在模板的/sandbox或者/testcases子页面或在自己的zh-cn:用户页; zh-tw:使用者頁面; zh-hk:用戶頁;测试。测试过的内容可以一次更改。修改前请考虑至讨论页讨论变更。 |
模板介绍
使用方法
{{if pagename <!-- Match on full pagename --> | User:Example/test = Text for "User:Example/test". | User:Example = Text for "User:Example". | User talk:Example = Text for "User talk:Example". <!-- Match on full basepage name, when on a basepage or its subpages --> | User:Example/+ = Matches "User:Example" and "User:Example/test". <!-- Match on pagename, when on a basepage --> | Example = Matches "User:Example", "User talk:Example", "Template:Example" and so on, but not "User:Example/something". <!-- Match on full basepage name, when on a subpage --> | User:Example/* = Matches "User:Example/something", but not "User:Example". | User talk:Example/* = Matches "User talk:Example/something". <!-- Match on basepage name, when on a subpage --> | Example/* = Matches "User:Example/something" and "User talk:Example/something". <!-- Match on subpage name --> | /something = Any pagename that ends in "/something". | /doc = Any pagename that ends in "/doc". <!-- Match on partial subpage name (case-insensitive) --> | /some* = Any subpage name beginning with "/some" or "/Some". | /arch* = Matches "User talk:Example/Archive 1". <!-- Default fallbacks --> | basepage = Text for any basepage. | subpage = Text for any subpage. | other = Text for any page. }}