Template:NameSortTest: Difference between revisions

From Jenny Everywhere Wiki
(Created page with "<includeonly>{{DEFAULTSORT: {{#switch:#rpos:{{PAGENAME}}|)}} |-1= {{#switch:#rpos:{{PAGENAME}}| }} |-1 = {{PAGENAME}} <!--just go by the pagename if there are no space...")
 
m (15 revisions imported)
Tags: Mobile edit Mobile web edit
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{DEFAULTSORT:
<includeonly>
{{DEFAULTSORT:
{{#switch:{{#rpos:{{PAGENAME}}|)}}
|-1= <!--if there are no close parentheses, then look for spaces-->
    {{#switch:{{#rpos:{{PAGENAME}}| }}
    |-1 = {{PAGENAME}} <!--if there are no spaces, then just go by the PAGENAME-->
    |#default ={{#sub:{{PAGENAME}}|{{#rpos:{{PAGENAME}}| }}|7}}<!-- if there are 
                                                spaces, then do something clever-->
}} <!-- first switch close-->
|#default = {{#explode:{{#sub:{{PAGENAME}}|0|{{#expr:{{#rpos:{{PAGENAME}}|(}}-1}}}}| |-1}}
 
}} <!--second switch close-->
}} <!--DEFAULTSORT close-->


{{#switch:#rpos:{{PAGENAME}}|)}}
|-1=
    {{#switch:#rpos:{{PAGENAME}}| }}
    |-1 = {{PAGENAME}} <!--just go by the pagename if there are no spaces in PAGENAME-->
    |#default = something clever
 
|#default = do something to truncate the disambig term and sort by the last word before the disambig term
=
</includeonly><noinclude>[[Category:coding utility templates|Name]]{{documentation}}{{lock}}
</includeonly><noinclude>[[Category:coding utility templates|Name]]{{documentation}}{{lock}}


This is a testing ground for expanding the powers of {{tl|NameSort}}.  It is in no way complete.  Please do not attempt to edit it.   
This is a testing ground for expanding the powers of {{tl|NameSort}}.  It is in no way complete.  Please do not attempt to edit it.   
{{#rpos:Mavic Chen| }}
 
* John Smith (actor)
{{#explode:{{#sub:John Smith (actor)|0|{{#expr:{{#rpos:John Smith (actor)|(}}-1}}}}| |-1}}
 
 
{{#switch:{{#rpos:John Smith (actor)|)}}
|-1={{#switch:{{#rpos:John Smith (actor)| }}
  |-1=John Smith (actor)
  |#default={{#sub:John Smith (actor)|{{#rpos:John Smith (actor)| }}|7}} }}
|#default = {{#explode:{{#sub:John Smith (actor)|0|{{#expr:{{#rpos:John Smith (actor)|(}}-1}}}}| |-1}}
}} <!--second switch close-->
 
 
 
 
</noinclude>

Latest revision as of 01:33, 13 August 2024

Template:Lock

This is a testing ground for expanding the powers of {{NameSort}}. It is in no way complete. Please do not attempt to edit it.

  • John Smith (actor)

Smith


Smith