Template:CPDL Editor: Difference between revisions
Jump to navigation
Jump to search
(new template to change "User:" to "Editor:" on a page in the User: namespace and categorize that page in Category:CPDL Editors) |
(extend to categorize when it appears on a page in Main: namespace - i.e., on a Composer page, using DEFAULTSORT) |
||
| Line 1: | Line 1: | ||
<includeonly>{{# | <includeonly>{{#switch: {{NAMESPACE}} | ||
|User = {{DISPLAYTITLE:Editor:{{PAGENAME}}}}[[Category:CPDL Editors|{{{1|{{NameSorter}}}}}]] | |||
| = [[Category:CPDL Editors]]|}}</includeonly><noinclude> | |||
[[Category:Templates]] | [[Category:Templates]] | ||
{{DisplayBox|bgcolor=g|text= | {{DisplayBox|bgcolor=g | ||
When this template appears on a page in the User: namespace, then the word "User:" in the page title is changed to "Editor:", and the page is categorized in {{CiteCat|CPDL Editors}}. An optional parameter may be supplied to provide a sortkey different from that generated by {{CiteTemp|NameSorter|br=}}. Thus, | |text= | ||
'''Usage''' | |||
* When this template appears on a User page (i.e. a page in the User: namespace), then the word "User:" in the page title is changed to "Editor:", and the page is categorized in {{CiteCat|CPDL Editors}}. An optional parameter may be supplied to provide a sortkey different from that generated by {{CiteTemp|NameSorter|br=}}. Thus, | |||
<pre>{{CPDL Editor}}</pre> | <pre>{{CPDL Editor}}</pre> | ||
on, say a page User:Karl von Staudt will cause the page title to be displayed as "Editor:Karl von Staudt" and the page categorized with sortkey "Staudt, Karl von", but | : on, say, a page User:Karl von Staudt will cause the page title to be displayed as "Editor:Karl von Staudt" and the page categorized with sortkey "Staudt, Karl von", but | ||
<pre>{{CPDL Editor|von Staudt, Karl}}</pre> | <pre>{{CPDL Editor|von Staudt, Karl}}</pre> | ||
will have the effect of categorizing with sortkey "von Staudt, Karl". | : will have the effect of categorizing with sortkey "von Staudt, Karl". | ||
* If this template is applied to a page in the Main: namespace (typically a Composer page), then the template simply categorizes the page in {{CiteCat|CPDL Editors}} using the DEFAULTSORT key for the page. | |||
* If this template is applied to a page in anyother namespace, it does nothing. | |||
}} | }} | ||
</noinclude> | </noinclude> | ||
Latest revision as of 14:46, 26 May 2010
Usage
- When this template appears on a User page (i.e. a page in the User: namespace), then the word "User:" in the page title is changed to "Editor:", and the page is categorized in CPDL Editors. An optional parameter may be supplied to provide a sortkey different from that generated by {{NameSorter}}. Thus,
{{CPDL Editor}}
- on, say, a page User:Karl von Staudt will cause the page title to be displayed as "Editor:Karl von Staudt" and the page categorized with sortkey "Staudt, Karl von", but
{{CPDL Editor|von Staudt, Karl}}
- will have the effect of categorizing with sortkey "von Staudt, Karl".
- If this template is applied to a page in the Main: namespace (typically a Composer page), then the template simply categorizes the page in CPDL Editors using the DEFAULTSORT key for the page.
- If this template is applied to a page in anyother namespace, it does nothing.