Espd banner horizontal.png

Difference between revisions of "Template:PlayerTabsHeader"

From Esportspedia - Smite Esports Wiki
Jump to: navigation, search
 
Line 1: Line 1:
 
<includeonly>{{#vardefine:N|2}}{{#vardefine:THIS|1}}{{#vardefine:PLAYERNAME|{{#titleparts:{{FULLPAGENAME}}|1}}}}<!--
 
<includeonly>{{#vardefine:N|2}}{{#vardefine:THIS|1}}{{#vardefine:PLAYERNAME|{{#titleparts:{{FULLPAGENAME}}|1}}}}<!--
 +
 
Start Stats
 
Start Stats
  
 
-->{{#ifexist:{{#var:PLAYERNAME}}/Statistics|{{#vardefine:tab{{#var:N}}|Statistics}}<!--
 
-->{{#ifexist:{{#var:PLAYERNAME}}/Statistics|{{#vardefine:tab{{#var:N}}|Statistics}}<!--
                                     -->{{#ifeq:{{#titleparts:{{FULLPAGENAME}}|1|2}}|Statistics|{{#vardefine:THIS|{{#var:N}}}}{{#vardefine:TYPE|Stats}} }}<!--
+
                                     -->{{#ifeq:{{#titleparts:{{FULLPAGENAME}}|1|2}}|Statistics|[[Category:{{#titleparts:{{PAGENAME}}|1|3}} Player Statistics Pages]]{{#vardefine:THIS|{{#var:N}}}}{{#vardefine:TYPE|Stats}} }}<!--
 
                                     -->{{#vardefine:N|{{#expr:{{#var:N}}+1}}}} }}<!--
 
                                     -->{{#vardefine:N|{{#expr:{{#var:N}}+1}}}} }}<!--
 
Start Match History
 
Start Match History
  
 
-->{{#ifexist:{{#var:PLAYERNAME}}/Match History|{{#vardefine:tab{{#var:N}}|Match History}}<!--
 
-->{{#ifexist:{{#var:PLAYERNAME}}/Match History|{{#vardefine:tab{{#var:N}}|Match History}}<!--
                                     -->{{#ifeq:{{#titleparts:{{FULLPAGENAME}}|1|2}}|Match History|{{#vardefine:THIS|{{#var:N}}}} }}<!--
+
                                     -->{{#ifeq:{{#titleparts:{{FULLPAGENAME}}|1|2}}|Match History|[[Category:Player Match Histories]]{{#vardefine:THIS|{{#var:N}}}} }}<!--
 
                                     -->{{#vardefine:N|{{#expr:{{#var:N}}+1}}}} }}<!--
 
                                     -->{{#vardefine:N|{{#expr:{{#var:N}}+1}}}} }}<!--
 
Start Stream
 
Start Stream
  
 
-->{{#ifexist:{{#var:PLAYERNAME}}/Stream|{{#vardefine:tab{{#var:N}}|Stream}}<!--
 
-->{{#ifexist:{{#var:PLAYERNAME}}/Stream|{{#vardefine:tab{{#var:N}}|Stream}}<!--
                                           -->{{#ifeq:{{#titleparts:{{FULLPAGENAME}}|1|2}}|Stream|{{#vardefine:THIS|{{#var:N}}}} }}<!--
+
                                           -->{{#ifeq:{{#titleparts:{{FULLPAGENAME}}|1|2}}|Stream|[[Category:Player Stream Embeds]]{{#vardefine:THIS|{{#var:N}}}} }}<!--
 
                                           -->{{#vardefine:N|{{#expr:{{#var:N}}+1}}}} }}<!--
 
                                           -->{{#vardefine:N|{{#expr:{{#var:N}}+1}}}} }}<!--
  
Line 21: Line 22:
  
 
-->{{#vardefine:S|0}}{{#vardefine:STHIS|1}}<!--
 
-->{{#vardefine:S|0}}{{#vardefine:STHIS|1}}<!--
 +
-->{{#ifexist:{{#var:PLAYERNAME}}/Statistics/2013|<!--
 +
        -->{{#vardefine:S|{{#expr:{{#var:S}}+1}}}}<!--
 +
-->{{#vardefine:year{{#var:S}}|2013}}<!--
 +
        -->{{#ifeq:{{#titleparts:{{FULLPAGENAME}}|1|3}}|2013|{{#vardefine:STHIS|{{#var:S}}}} }} }}<!--
  
 
Start 2014
 
Start 2014
Line 35: Line 40:
 
         -->{{#vardefine:year{{#var:S}}|2015}}<!--
 
         -->{{#vardefine:year{{#var:S}}|2015}}<!--
 
         -->{{#ifeq:{{#titleparts:{{FULLPAGENAME}}|1|3}}|2015|{{#vardefine:STHIS|{{#var:S}}}} }} }} <!--
 
         -->{{#ifeq:{{#titleparts:{{FULLPAGENAME}}|1|3}}|2015|{{#vardefine:STHIS|{{#var:S}}}} }} }} <!--
 +
 +
 +
Start 2016
 +
 +
-->{{#ifexist:{{#var:PLAYERNAME}}/Statistics/2016|<!--
 +
        -->{{#vardefine:S|{{#expr:{{#var:S}}+1}}}} <!--
 +
        -->{{#vardefine:year{{#var:S}}|2016}}<!--
 +
        -->{{#ifeq:{{#titleparts:{{FULLPAGENAME}}|1|3}}|2016|{{#vardefine:STHIS|{{#var:S}}}} }} }} <!--
  
 
Now that we have all the variables defined, we can actually make the top row of tabs.
 
Now that we have all the variables defined, we can actually make the top row of tabs.
Line 53: Line 66:
 
-->{{#ifeq:{{#var:TYPE}}|Stats|<!-- But we'll also want to check and make sure we actually have multiple stats pages:
 
-->{{#ifeq:{{#var:TYPE}}|Stats|<!-- But we'll also want to check and make sure we actually have multiple stats pages:
 
         -->{{#ifexpr: {{#var:S}} > 1 |<!--
 
         -->{{#ifexpr: {{#var:S}} > 1 |<!--
-->{{TabsHeader
+
--><br>{{TabsHeader
 
|name1={{#var:year1}}
 
|name1={{#var:year1}}
 
|link1={{#var:PLAYERNAME}}/Statistics/{{#var:year1}}
 
|link1={{#var:PLAYERNAME}}/Statistics/{{#var:year1}}
 
|name2={{#var:year2}}
 
|name2={{#var:year2}}
 
|link2={{#var:PLAYERNAME}}/Statistics/{{#var:year2}}
 
|link2={{#var:PLAYERNAME}}/Statistics/{{#var:year2}}
 +
|name3={{#var:year3}}
 +
|link3={{#var:PLAYERNAME}}/Statistics/{{#var:year3}}
 +
|name4={{#var:year4}}
 +
|link4={{#var:PLAYERNAME}}/Statistics/{{#var:year4}}
 
|This={{#var:STHIS}} }}<!--End stats page creation!-->}} }}</includeonly><noinclude>{{documentation}}</noinclude>
 
|This={{#var:STHIS}} }}<!--End stats page creation!-->}} }}</includeonly><noinclude>{{documentation}}</noinclude>

Latest revision as of 19:22, February 10, 2016

(view - edit) Documentation

This is a relatively complicated and sensitive template that affects a large number of pages. Please use caution if editing.

Automatically creates {{TabsHeader}}s on player pages with all pages that exist as subpages to that player's page.

Currently supports:

  • Statistics
    • Statistics/2014
    • Statistics/2015
  • Match History
  • Stream

Usage

Write:

{{PlayerTabsHeader}}

at the top of the secondary-content page (e.g. Playername/Statistics, Playername/Stream, etc). Tabs will automatically be generated supporting the above pages.

Notes

If you wish to have a second row of tabs for Statistics, you may NOT title any of the pages Statistics. They must be Statistics/2014, Statistics/2015, etc. If you only have ONE page of statistics, then Statistics alone is okay.

However, if you want Stats tabs to show up, the page Playername/Statistics must exist!!! Just make it redirect to something. It doesn't matter, it'll never actually get used. (If you DON'T want a Stats tabs, then this page shouldn't exist.)