Template:NavSpecies: Difference between revisions

From Portals of Phereon Wiki
Content added Content deleted
portalsofphereon>Olaroll
No edit summary
m (add possibility of adding a class to a tabler)
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#tag:tabview|
<includeonly><templatestyles src="NavSpecies/NavSpecies.css" />
{{#if:{{{16|}}}|<span class="error">[[Template:NavSpecies]]: Too many tabs; maximum is 15.</span>[[Category:Template errors]]|
<!-- if Parameter not empty -> Template:NavSpecies/Parameter|Parameter (Parameter gets capitalized if necessary) -->
{{#vardefine:i|{{#if:{{{1|}}}|1}}}}
{{#if:{{{1|}}}|Template:NavSpecies/{{ucfirst:{{{1|}}}}}{{!}}{{ucfirst:{{{1|}}}}}}}{{#ifeq:{{{open|}}}|1|{{!}}{{!}}true}}
{{#if:{{{2|}}}|Template:NavSpecies/{{ucfirst:{{{2|}}}}}{{!}}{{ucfirst:{{{2|}}}}}}}{{#ifeq:{{{open|}}}|2|{{!}}{{!}}true}}
<div class="tabber-NavSpecies {{#if:{{#replace:{{{class|}}}| |}}|tabber-{{#replace:{{{class|}}}| |}}|}}" data-open-tab="{{{open|1}}}">
{{#tag:tabber|
{{#if:{{{3|}}}|Template:NavSpecies/{{ucfirst:{{{3|}}}}}{{!}}{{ucfirst:{{{3|}}}}}}}{{#ifeq:{{{open|}}}|3|{{!}}{{!}}true}}
{{#while:
{{#if:{{{4|}}}|Template:NavSpecies/{{ucfirst:{{{4|}}}}}{{!}}{{ucfirst:{{{4|}}}}}}}{{#ifeq:{{{open|}}}|4|{{!}}{{!}}true}}
| {{{{{#var:i}}|}}}
{{#if:{{{5|}}}|Template:NavSpecies/{{ucfirst:{{{5|}}}}}{{!}}{{ucfirst:{{{5|}}}}}}}{{#ifeq:{{{open|}}}|5|{{!}}{{!}}true}}
{{#if:{{{6|}}}|Template:NavSpecies/{{ucfirst:{{{6|}}}}}{{!}}{{ucfirst:{{{6|}}}}}}}{{#ifeq:{{{open|}}}|6|{{!}}{{!}}true}}
| {{ucfirst:{{{{{#var:i}}|}}}}}​={{NavSpecies/{{ucfirst:{{{{{#var:i}}|}}}}}}}{{!}}-{{!}}
{{#vardefine:i|{{#expr:{{#var:i}}+1}}}}
{{#if:{{{7|}}}|Template:NavSpecies/{{ucfirst:{{{7|}}}}}{{!}}{{ucfirst:{{{7|}}}}}}}{{#ifeq:{{{open|}}}|7|{{!}}{{!}}true}}
}}
{{#if:{{{8|}}}|Template:NavSpecies/{{ucfirst:{{{8|}}}}}{{!}}{{ucfirst:{{{8|}}}}}}}{{#ifeq:{{{open|}}}|8|{{!}}{{!}}true}}
}}
{{#if:{{{9|}}}|Template:NavSpecies/{{ucfirst:{{{9|}}}}}{{!}}{{ucfirst:{{{9|}}}}}}}{{#ifeq:{{{open|}}}|9|{{!}}{{!}}true}}
</div>
{{#if:{{{10|}}}|Template:NavSpecies/{{ucfirst:{{{10|}}}}}{{!}}{{ucfirst:{{{10|}}}}}}}{{#ifeq:{{{open|}}}|10|{{!}}{{!}}true}}
}}
{{#if:{{{11|}}}|Template:NavSpecies/{{ucfirst:{{{11|}}}}}{{!}}{{ucfirst:{{{11|}}}}}}}{{#ifeq:{{{open|}}}|11|{{!}}{{!}}true}}
</includeonly><!--
{{#if:{{{12|}}}|Template:NavSpecies/{{ucfirst:{{{12|}}}}}{{!}}{{ucfirst:{{{12|}}}}}}}{{#ifeq:{{{open|}}}|12|{{!}}{{!}}true}}
IMPORTANT NOTE: There is a zero width space (there is one here >​<) before each = sign. This is to prevent an issue with tabber when the tab name and a link in said tab have the same name.
{{#if:{{{13|}}}|Template:NavSpecies/{{ucfirst:{{{13|}}}}}{{!}}{{ucfirst:{{{13|}}}}}}}{{#ifeq:{{{open|}}}|13|{{!}}{{!}}true}}
{{#if:{{{14|}}}|Template:NavSpecies/{{ucfirst:{{{14|}}}}}{{!}}{{ucfirst:{{{14|}}}}}}}{{#ifeq:{{{open|}}}|14|{{!}}{{!}}true}}
{{#if:{{{15|}}}|Template:NavSpecies/{{ucfirst:{{{15|}}}}}{{!}}{{ucfirst:{{{15|}}}}}}}{{#ifeq:{{{open|}}}|15|{{!}}{{!}}true}}
<!-- If needed, add more lines with the same pattern here -->
}}</includeonly><!--

--><noinclude>{{Documentation}}</noinclude>
--><noinclude>{{Documentation}}</noinclude>

Latest revision as of 01:27, 25 July 2022

[view | edit | purge]Documentation
Description
Creates a species visual navbox with up to 15 tabs based on given parameters.
Info
All valid tabs can be found here
The first letter of parameters will always get capitalized
The optional open=# parameter can be used to specify which tab is open by default
The optional class= parameter can be used to add class to the tabler. currently available: wide
See also Template:NavSpeciesBasic
Tab color styles are done in Template:NavSpecies/NavSpecies.css
Example
For example using this:
{{NavSpecies|open=3|shadow|Harpy|mermaid|Beast}}

Will result in this:

[view | edit | purge]The above documentation is transcluded fromTemplate:NavSpecies/doc.