Template:HeroTabs: Difference between revisionsGive feedback
Jump to navigation
Jump to search
Updated template logic to correctly highlight tabs on pages with special characters (e.g., Mo & Krill) and on subpages (e.g., /Update_history). |
m Add translate template. |
||
| Line 1: | Line 1: | ||
<includeonly><div style="border-radius: 8px;background-image: linear-gradient(#987556, #483728); color:#FFF5E8; margin:0 auto 1em; display:flex; flex-wrap:wrap; justify-content:center; align-items:flex-end; gap:1em; padding:0px; font-family:'Retail Demo','Radiance',sans-serif; text-transform:uppercase; font-weight:bold; font-size:15px;"><!-- | <includeonly><div style="border-radius: 8px;background-image: linear-gradient(#987556, #483728); color:#FFF5E8; margin:0 auto 1em; display:flex; flex-wrap:wrap; justify-content:center; align-items:flex-end; gap:1em; padding:0px; font-family:'Retail Demo','Radiance',sans-serif; text-transform:uppercase; font-weight:bold; font-size:15px;"><!-- | ||
-->{{#ifexist:{{{1|{{ROOTPAGENAME}}}}}| <div style="{{#ifeq: {{FULLPAGENAMEE}} | {{{1|{{ROOTPAGENAMEE}}}}} | background-color:#FFF0D6; color:#483728; padding:4px 8px; border-radius: 4px 4px 0 0; | padding:4px 8px; cursor:pointer }}">[[{{{1|{{ROOTPAGENAME}}}}}|<span style="{{#ifeq: {{FULLPAGENAMEE}} | {{{1|{{ROOTPAGENAMEE}}}}} | color:#483728; | color:#FFF0D6; text-shadow: 0px 2px 2px black, 0px 0px 2px black; }}">Overview</span>]]</div>|}}<!-- | -->{{#ifexist:{{{1|{{ROOTPAGENAME}}}}}| <div style="{{#ifeq: {{FULLPAGENAMEE}} | {{{1|{{ROOTPAGENAMEE}}}}} | background-color:#FFF0D6; color:#483728; padding:4px 8px; border-radius: 4px 4px 0 0; | padding:4px 8px; cursor:pointer }}">[[{{{1|{{ROOTPAGENAME}}}}}|<span style="{{#ifeq: {{FULLPAGENAMEE}} | {{{1|{{ROOTPAGENAMEE}}}}} | color:#483728; | color:#FFF0D6; text-shadow: 0px 2px 2px black, 0px 0px 2px black; }}">{{translate|Overview}}</span>]]</div>|}}<!-- | ||
-->{{#ifexist:{{{1|{{ROOTPAGENAME}}}}}/Quotes| <div style="{{#ifeq: {{FULLPAGENAMEE}} | {{{1|{{ROOTPAGENAMEE}}}}}/Quotes | background-color:#FFF0D6; color:#483728; padding:4px 8px; border-radius: 4px 4px 0 0; | padding:4px 8px; cursor:pointer }}">[[{{{1|{{ROOTPAGENAME}}}}}/Quotes|<span style="{{#ifeq: {{FULLPAGENAMEE}} | {{{1|{{ROOTPAGENAMEE}}}}}/Quotes | color:#483728; | color:#FFF0D6; text-shadow: 0px 2px 2px black, 0px 0px 2px black; }}">Quotes</span>]]</div>|}}<!-- | -->{{#ifexist:{{{1|{{ROOTPAGENAME}}}}}/Quotes| <div style="{{#ifeq: {{FULLPAGENAMEE}} | {{{1|{{ROOTPAGENAMEE}}}}}/Quotes | background-color:#FFF0D6; color:#483728; padding:4px 8px; border-radius: 4px 4px 0 0; | padding:4px 8px; cursor:pointer }}">[[{{{1|{{ROOTPAGENAME}}}}}/Quotes|<span style="{{#ifeq: {{FULLPAGENAMEE}} | {{{1|{{ROOTPAGENAMEE}}}}}/Quotes | color:#483728; | color:#FFF0D6; text-shadow: 0px 2px 2px black, 0px 0px 2px black; }}">{{translate|Quotes}}</span>]]</div>|}}<!-- | ||
-->{{#ifexist:{{{1|{{ROOTPAGENAME}}}}}/Sounds| <div style="{{#ifeq: {{FULLPAGENAMEE}} | {{{1|{{ROOTPAGENAMEE}}}}}/Sounds | background-color:#FFF0D6; color:#483728; padding:4px 8px; border-radius: 4px 4px 0 0; | padding:4px 8px; cursor:pointer }}">[[{{{1|{{ROOTPAGENAME}}}}}/Sounds|<span style="{{#ifeq: {{FULLPAGENAMEE}} | {{{1|{{ROOTPAGENAMEE}}}}}/Sounds | color:#483728; | color:#FFF0D6; text-shadow: 0px 2px 2px black, 0px 0px 2px black; }}">Sounds</span>]]</div>|}}<!-- | -->{{#ifexist:{{{1|{{ROOTPAGENAME}}}}}/Sounds| <div style="{{#ifeq: {{FULLPAGENAMEE}} | {{{1|{{ROOTPAGENAMEE}}}}}/Sounds | background-color:#FFF0D6; color:#483728; padding:4px 8px; border-radius: 4px 4px 0 0; | padding:4px 8px; cursor:pointer }}">[[{{{1|{{ROOTPAGENAME}}}}}/Sounds|<span style="{{#ifeq: {{FULLPAGENAMEE}} | {{{1|{{ROOTPAGENAMEE}}}}}/Sounds | color:#483728; | color:#FFF0D6; text-shadow: 0px 2px 2px black, 0px 0px 2px black; }}">{{translate|Sounds}}</span>]]</div>|}}<!-- | ||
-->{{#ifexist:{{{1|{{ROOTPAGENAME}}}}}/Update_history|<div style="{{#ifeq: {{FULLPAGENAMEE}} | {{{1|{{ROOTPAGENAMEE}}}}}/Update_history | background-color:#FFF0D6; color:#483728; padding:4px 8px; border-radius: 4px 4px 0 0; | padding:4px 8px; cursor:pointer }}">[[{{{1|{{ROOTPAGENAME}}}}}/Update_history|<span style="{{#ifeq: {{FULLPAGENAMEE}} | {{{1|{{ROOTPAGENAMEE}}}}}/Update_history | color:#483728; | color:#FFF0D6; text-shadow: 0px 2px 2px black, 0px 0px 2px black; }}">Update | -->{{#ifexist:{{{1|{{ROOTPAGENAME}}}}}/Update_history|<div style="{{#ifeq: {{FULLPAGENAMEE}} | {{{1|{{ROOTPAGENAMEE}}}}}/Update_history | background-color:#FFF0D6; color:#483728; padding:4px 8px; border-radius: 4px 4px 0 0; | padding:4px 8px; cursor:pointer }}">[[{{{1|{{ROOTPAGENAME}}}}}/Update_history|<span style="{{#ifeq: {{FULLPAGENAMEE}} | {{{1|{{ROOTPAGENAMEE}}}}}/Update_history | color:#483728; | color:#FFF0D6; text-shadow: 0px 2px 2px black, 0px 0px 2px black; }}">{{translate|Update history}}</span>]]</div>|}}<!-- | ||
--></div></includeonly><!-- | --></div></includeonly><!-- | ||
--><noinclude>{{Documentation}}</noinclude> | --><noinclude>{{Documentation}}</noinclude> | ||
Revision as of 12:32, 10 September 2025
This template uses CSS found at HeroTabs/styles.css.
Usage
Adds a navigation header for a main page and its subpages. Mainly used for heroes but also works for other pages if it has the same subpages.
Place this template at the top of the relevant pages. The template automatically detects which subpages exist and highlights the current (active) page's tab.
Example
Using the code:
{{HeroTabs}}
Will render the navigation bar. The example below shows how it appears on the "Sounds" page, with that tab highlighted as active.