Template:NameSortTest: Difference between revisions

From Tardis Wiki, the free Doctor Who reference
No edit summary
m (Protected "Template:NameSortTest": If you'd like to suggest changes to this template, please do so at forum:Panopticon. This template is being protected because it impacts many other pages and templates. ([edit=sysop] (indefinite) [move=sysop] (in)
 
(4 intermediate revisions by one other user not shown)
Line 5: Line 5:
     {{#switch:{{#rpos:{{PAGENAME}}| }}
     {{#switch:{{#rpos:{{PAGENAME}}| }}
     |-1 = {{PAGENAME}} <!--if there are no spaces, then just go by the PAGENAME-->
     |-1 = {{PAGENAME}} <!--if there are no spaces, then just go by the PAGENAME-->
     |#default ={{#sub:{{PAGENAME}}|{{#rpos:{{PAGENAME}}| }}|7}}}}<!-- if there are   
     |#default ={{#sub:{{PAGENAME}}|{{#rpos:{{PAGENAME}}| }}|7}}<!-- if there are   
                                                 spaces, then do something clever-->
                                                 spaces, then do something clever-->
}} <!--first switch close-->
}} <!-- first switch close-->
|#default = {{#explode:{{#sub:{{PAGENAME}}|0|{{#expr:{{#rpos:{{PAGENAME}}|(}}-1}}}}| |-1}}
|#default = {{#explode:{{#sub:{{PAGENAME}}|0|{{#expr:{{#rpos:{{PAGENAME}}|(}}-1}}}}| |-1}}


Line 22: Line 22:


{{#switch:{{#rpos:John Smith (actor)|)}}
{{#switch:{{#rpos:John Smith (actor)|)}}
|-1= <!--if there are no close parentheses, then look for spaces-->
|-1={{#switch:{{#rpos:John Smith (actor)| }}
    {{#switch:{{#rpos:John Smith (actor)| }}
  |-1=John Smith (actor)
    |-1 = John Smith (actor) <!--if there are no spaces, then just go by the PAGENAME-->
  |#default={{#sub:John Smith (actor)|{{#rpos:John Smith (actor)| }}|7}} }}  
    |#default ={{#sub:John Smith (actor)|{{#rpos:John Smith (actor)| }}|7}}}}<!-- if there are 
|#default = {{#explode:{{#sub:John Smith (actor)|0|{{#expr:{{#rpos:John Smith (actor)|(}}-1}}}}| |-1}}  
                                                spaces, then do something clever-->
}} <!--first switch close-->
|#default = {{#explode:{{#sub:John Smith (actor)|0|{{#expr:{{#rpos:John Smith (actor)|(}}-1}}}}| |-1}}
 
}} <!--second switch close-->
}} <!--second switch close-->



Latest revision as of 05:16, 15 May 2012

Instructions for {{NameSortTest}}
LockedTab.png

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