Welcome to the DFO World Wiki. With many major updates since the release of DFO, many items are missing. Visit Item Database Project to learn more.
Please remember to click "show preview" before saving the page.
Thanks for the updated logo snafuPop!

Difference between revisions of "Template:PageTabs"

From DFO World Wiki
Jump to: navigation, search
m
m
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly><table cellspacing="10" cellpadding="20"><tr>
 
<includeonly><table cellspacing="10" cellpadding="20"><tr>
 
   {{#if:{{{tab1|}}}|
 
   {{#if:{{{tab1|}}}|
     <th style="{{#ifeq:{{SUBPAGENAME}}|{{{tab1}}}|
+
     <th style="
      |
+
      {{#ifeq:{{SUBPAGENAME}}|{{{tab1}}} <!--Check for active-tab -->
      {{TabBox}}
+
      |{{TabBox|bg=#36454F}}
    }}
+
      |{{#ifeq:{{PAGENAME}}|{{{rootpage|{{ROOTPAGENAME}}}}}
 +
        |{{TabBox|bg=#36454F}}
 +
        |{{TabBox}}
 +
        }}
 +
      }}
 
     "
 
     "
     ><div>[[{{{namespace|{{NAMESPACE}}}}}:{{#ifeq:{{{subpages|1}}}|1|{{{rootpage|{{ROOTPAGENAME}}}}}{{!}}{{{tab1}}}|{{{tab1}}}{{!}}{{{tab1name|{{{tab1}}}}}}}}]]</div>
+
     ><div>[[{{{namespace|{{NAMESPACE}}}}}:{{#ifeq:{{{subpages|1}}}|1|{{{rootpage|{{ROOTPAGENAME}}}}}{{!}}<span style="color: #f8d8a8; text-decoration: inherit; -moz-text-decoration-color: #f8d8a8; text-decoration-color: #f8d8a8;">{{{tab1}}}</span>|{{{tab1}}}{{!}}<span style="color: #f8d8a8; text-decoration: inherit; -moz-text-decoration-color: #f8d8a8; text-decoration-color: #f8d8a8;">{{{tab1name|{{{tab1}}}}}}</span>}}]]</div>
 
     </th>
 
     </th>
 
   }}
 
   }}
 
   {{#if:{{{tab2|}}}|
 
   {{#if:{{{tab2|}}}|
 
     <th style="
 
     <th style="
       {{TabBox}}
+
       {{#ifeq:{{SUBPAGENAME}}|{{{tab2}}} <!--Check for active-tab -->
 +
      |{{TabBox|bg=#36454F}}
 +
      |{{TabBox}}
 +
      }}
 
     "
 
     "
     ><div>[[{{{namespace|{{NAMESPACE}}}}}:{{#ifeq:{{{subpages|1}}}|1|{{{rootpage|{{ROOTPAGENAME}}}}}/|}}{{{tab2}}}|{{{tab2name|{{{tab2}}}}}}]]</div>
+
     ><div>[[{{{namespace|{{NAMESPACE}}}}}:{{#ifeq:{{{subpages|1}}}|1|{{{rootpage|{{ROOTPAGENAME}}}}}/|}}{{{tab2}}}|<span style="color: #f8d8a8; text-decoration: inherit; -moz-text-decoration-color: #f8d8a8; text-decoration-color: #f8d8a8;">{{{tab2name|{{{tab2}}}}}}</span>]]</div>
 
     </th>
 
     </th>
 
   }}
 
   }}
 
   {{#if:{{{tab3|}}}|
 
   {{#if:{{{tab3|}}}|
 
     <th style="
 
     <th style="
       {{TabBox}}
+
       {{#ifeq:{{SUBPAGENAME}}|{{{tab3}}} <!--Check for active-tab -->
 +
      |{{TabBox|bg=#36454F}}
 +
      |{{TabBox}}
 +
      }}
 
     "
 
     "
     ><div>[[{{{namespace|{{NAMESPACE}}}}}:{{#ifeq:{{{subpages|1}}}|1|{{{rootpage|{{ROOTPAGENAME}}}}}/|}}{{{tab3}}}|{{{tab3name|{{{tab3}}}}}}]]</div>
+
     ><div>[[{{{namespace|{{NAMESPACE}}}}}:{{#ifeq:{{{subpages|1}}}|1|{{{rootpage|{{ROOTPAGENAME}}}}}/|}}{{{tab3}}}|<span style="color: #f8d8a8; text-decoration: inherit; -moz-text-decoration-color: #f8d8a8; text-decoration-color: #f8d8a8;">{{{tab3name|{{{tab3}}}}}}</span>]]</div>
 
     </th>
 
     </th>
 
   }}
 
   }}
 
   {{#if:{{{tab4|}}}|
 
   {{#if:{{{tab4|}}}|
 
     <th style="
 
     <th style="
       {{TabBox}}
+
       {{#ifeq:{{SUBPAGENAME}}|{{{tab4}}} <!--Check for active-tab -->
 +
      |{{TabBox|bg=#36454F}}
 +
      |{{TabBox}}
 +
      }}
 
     "
 
     "
     ><div>[[{{{namespace|{{NAMESPACE}}}}}:{{#ifeq:{{{subpages|1}}}|1|{{{rootpage|{{ROOTPAGENAME}}}}}/|}}{{{tab4}}}|{{{tab4name|{{{tab4}}}}}}]]</div>
+
     ><div>[[{{{namespace|{{NAMESPACE}}}}}:{{#ifeq:{{{subpages|1}}}|1|{{{rootpage|{{ROOTPAGENAME}}}}}/|}}{{{tab4}}}|<span style="color: #f8d8a8; text-decoration: inherit; -moz-text-decoration-color: #f8d8a8; text-decoration-color: #f8d8a8;">{{{tab4name|{{{tab4}}}}}}</span>]]</div>
 
     </th>
 
     </th>
 
   }}
 
   }}
 
   {{#if:{{{tab5|}}}|
 
   {{#if:{{{tab5|}}}|
 
     <th style="
 
     <th style="
       {{TabBox}}
+
       {{#ifeq:{{SUBPAGENAME}}|{{{tab5}}} <!--Check for active-tab -->
 +
      |{{TabBox|bg=#36454F}}
 +
      |{{TabBox}}
 +
      }}
 
     "
 
     "
     ><div>[[{{{namespace|{{NAMESPACE}}}}}:{{#ifeq:{{{subpages|1}}}|1|{{{rootpage|{{ROOTPAGENAME}}}}}/|}}{{{tab5}}}|{{{tab5name|{{{tab5}}}}}}]]</div>
+
     ><div>[[{{{namespace|{{NAMESPACE}}}}}:{{#ifeq:{{{subpages|1}}}|1|{{{rootpage|{{ROOTPAGENAME}}}}}/|}}{{{tab5}}}|<span style="color: #f8d8a8; text-decoration: inherit; -moz-text-decoration-color: #f8d8a8; text-decoration-color: #f8d8a8;">{{{tab5name|{{{tab5}}}}}}</span>]]</div>
 
     </th>
 
     </th>
 
   }}
 
   }}
 
   {{#if:{{{tab6|}}}|
 
   {{#if:{{{tab6|}}}|
 
     <th style="
 
     <th style="
       {{TabBox}}
+
       {{#ifeq:{{SUBPAGENAME}}|{{{tab6}}} <!--Check for active-tab -->
 +
      |{{TabBox|bg=#36454F}}
 +
      |{{TabBox}}
 +
      }}
 +
    "
 +
    ><div>[[{{{namespace|{{NAMESPACE}}}}}:{{#ifeq:{{{subpages|1}}}|1|{{{rootpage|{{ROOTPAGENAME}}}}}/|}}{{{tab6}}}|<span style="color: #f8d8a8; text-decoration: inherit; -moz-text-decoration-color: #f8d8a8; text-decoration-color: #f8d8a8;">{{{tab6name|{{{tab6}}}}}}</span>]]</div>
 +
    </th>
 +
  }}
 +
  {{#if:{{{tab7|}}}|
 +
    <th style="
 +
      {{#ifeq:{{SUBPAGENAME}}|{{{tab7}}} <!--Check for active-tab -->
 +
      |{{TabBox|bg=#36454F}}
 +
      |{{TabBox}}
 +
      }}
 +
    "
 +
    ><div>[[{{{namespace|{{NAMESPACE}}}}}:{{#ifeq:{{{subpages|1}}}|1|{{{rootpage|{{ROOTPAGENAME}}}}}/|}}{{{tab7}}}|<span style="color: #f8d8a8; text-decoration: inherit; -moz-text-decoration-color: #f8d8a8; text-decoration-color: #f8d8a8;">{{{tab7name|{{{tab7}}}}}}</span>]]</div>
 +
    </th>
 +
  }}
 +
  {{#if:{{{tab8|}}}|
 +
    <th style="
 +
      {{#ifeq:{{SUBPAGENAME}}|{{{tab8}}} <!--Check for active-tab -->
 +
      |{{TabBox|bg=#36454F}}
 +
      |{{TabBox}}
 +
      }}
 +
    "
 +
    ><div>[[{{{namespace|{{NAMESPACE}}}}}:{{#ifeq:{{{subpages|1}}}|1|{{{rootpage|{{ROOTPAGENAME}}}}}/|}}{{{tab8}}}|<span style="color: #f8d8a8; text-decoration: inherit; -moz-text-decoration-color: #f8d8a8; text-decoration-color: #f8d8a8;">{{{tab8name|{{{tab8}}}}}}</span>]]</div>
 +
    </th>
 +
  }}
 +
  {{#if:{{{tab9|}}}|
 +
    <th style="
 +
      {{#ifeq:{{SUBPAGENAME}}|{{{tab9}}} <!--Check for active-tab -->
 +
      |{{TabBox|bg=#36454F}}
 +
      |{{TabBox}}
 +
      }}
 +
    "
 +
    ><div>[[{{{namespace|{{NAMESPACE}}}}}:{{#ifeq:{{{subpages|1}}}|1|{{{rootpage|{{ROOTPAGENAME}}}}}/|}}{{{tab9}}}|<span style="color: #f8d8a8; text-decoration: inherit; -moz-text-decoration-color: #f8d8a8; text-decoration-color: #f8d8a8;">{{{tab9name|{{{tab9}}}}}}</span>]]</div>
 +
    </th>
 +
  }}
 +
  {{#if:{{{tab10|}}}|
 +
    <th style="
 +
      {{#ifeq:{{SUBPAGENAME}}|{{{tab10}}} <!--Check for active-tab -->
 +
      |{{TabBox|bg=#36454F}}
 +
      |{{TabBox}}
 +
      }}
 
     "
 
     "
     ><div>[[{{{namespace|{{NAMESPACE}}}}}:{{#ifeq:{{{subpages|1}}}|1|{{{rootpage|{{ROOTPAGENAME}}}}}/|}}{{{tab6}}}|{{{tab6name|{{{tab6}}}}}}]]</div>
+
     ><div>[[{{{namespace|{{NAMESPACE}}}}}:{{#ifeq:{{{subpages|1}}}|1|{{{rootpage|{{ROOTPAGENAME}}}}}/|}}{{{tab10}}}|<span style="color: #f8d8a8; text-decoration: inherit; -moz-text-decoration-color: #f8d8a8; text-decoration-color: #f8d8a8;">{{{tab10name|{{{tab10}}}}}}</span>]]</div>
 
     </th>
 
     </th>
 
   }}
 
   }}

Latest revision as of 21:45, 10 October 2021

Template Documentation view

This is the "PageTabs" template.

Note: This template's source code is based off of Genshin Impact Wiki's CustomTabs template. For documentation and more information, refer to the following link:

→ Source: Link to Genshin Impact Wiki's Template:CustomTabs

It should be called in the following format:

{{PageTabs
 |rootpage=
 |namespace=
 |subpages=
 |tab1=
 |tab2=
 |tab3=
 |tab4=
 |tab5=
 |tab6=
 }}
  • rootpage - title of root page if not using current page's root.
  • namespace - name of namespace if not using current page's namespace.
  • subpages - tabs are subpages of the first if set to 1, otherwise are not; default 1.
  • tab1 - title of first tab.
  • tab2, tab3, tab4, tab5, tab6, tab7, tab8, tab9, tab10 - title of subpage tabs.

This template can create up to ten page link tabs.

Examples

Example 1: Links within the same Namespace

{{PageTabs
|tab1=foo
|tab2=bar
|tab3=baz
}}

Example 2: Links with the same Rootpage

{{PageTabs
|rootpage=Blue Guardian Vetala
|namespace=
|tab1=Overview
|tab2=Dialogue
|tab3=Media
}}

Example 3: Links to Separate Pages

{{PageTabs
|namespace=
|subpages=0
|tab1=foo
|tab2=bar
|tab3=baz
}}