Template:NameSort: Difference between revisions
From Jenny Everywhere Wiki
No edit summary |
m (15 revisions imported) Tags: Mobile edit Mobile web edit |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly>{{DEFAULTSORT: | <includeonly>{{DEFAULTSORT: | ||
{{#switch:{{#rpos:{{PAGENAME}}|)}} | {{#switch:{{#rpos:{{{name|{{PAGENAME}}}}}|)}} | ||
|-1= <!--if there are no close parentheses, then look for spaces--> | |-1= <!--if there are no close parentheses, then look for spaces--> | ||
{{#switch:{{#rpos:{{PAGENAME}}| }} | {{#switch:{{#rpos:{{{name|{{PAGENAME}}}}}| }} | ||
<!--if there are no spaces, then just go by the PAGENAME--> | <!--if there are no spaces, then just go by the PAGENAME--> | ||
|-1 = {{PAGENAME}} | |-1 = {{{name|{{PAGENAME}}}}} | ||
<!--if there ARE spaces, then find the last word and use the first six digits | <!--if there ARE spaces, then find the last word and use the first six digits | ||
of it as the sort key --> | of it as the sort key --> | ||
|#default ={{#sub:{{PAGENAME}}|{{#rpos:{{PAGENAME}}| }}|7}},{{#explode:{{ | |#default ={{#sub:{{{name|{{PAGENAME}}}}}|{{#rpos:{{{name|{{PAGENAME}}}}}| }}|7}}, {{#explode:{{{name|{{PAGENAME}}}}}| |0}} | ||
}} <!-- first switch close--> | }} <!-- first switch close--> | ||
<!-- If there ARE close parentheses, use the word that immediately precedes the | <!-- If there ARE close parentheses, use the word that immediately precedes the | ||
open parentheses as the sort key --> | open parentheses as the sort key --> | ||
|#default = {{#explode:{{#sub:{{PAGENAME}}|0|{{#expr:{{#rpos:{{PAGENAME}}|(}}-1}}}}| |-1}} | |#default = {{#explode:{{#sub:{{{name|{{PAGENAME}}}}}|0|{{#expr:{{#rpos:{{{name|{{PAGENAME}}}}}|(}}-1}}}}| |-1}}, {{#explode:{{{name|{{PAGENAME}}}}}| |0}} {{#explode:{{{name|{{PAGENAME}}}}}|(|-1}} | ||
}} <!--second switch close--> | }} <!--second switch close--> | ||
}} <!--DEFAULTSORT close--></includeonly><noinclude>[[Category:coding utility templates| | }} <!--DEFAULTSORT close--></includeonly><noinclude>[[Category:coding utility templates|NameSort]]{{documentation}}{{lock}}</noinclude> |
Latest revision as of 01:33, 13 August 2024
Template documentation
|
---|
Note: portions of the template sample may not be visible without values provided. |
View or edit this documentation. (About template documentation) |
Editors can experiment in this template's sandbox and test case pages. |