Template:Header: Difference between revisions

From PZwiki
mNo edit summary
(added Template:Language code category to add pages to the category based on their language code)
 
(47 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly><div style="clear: both; border: 1px solid #000; background: #{{#ifeq:{{{1|}}}|Community|EBF3F4|{{#ifeq:{{{1|}}}|PZwiki|EBF3F4|{{#ifeq:{{PAGENAME}}|Community|EBF3F4|{{#ifeq:{{PAGENAME}}|PZwiki|EBF3F4|F4F3EB}}}}}}}}">
<noinclude>
<div class="tp-header" style="padding: 6px; background: #{{#ifeq:{{{1|}}}|Community|185893|{{#ifeq:{{{1|}}}|PZwiki|185893|{{#ifeq:{{PAGENAME}}|Community|185893|{{#ifeq:{{PAGENAME}}|PZwiki|185893|68191B}}}}}}}}; border-bottom: 1px solid #000; color: #fff;">
{{Protection}}
  <span style="padding: 9px 0px; border-right:1px solid #000; padding-right: 9px; color: #fff;">'''Navigation:'''</span><!--
{{Documentation/sandbox|doc =
This template is used to add a [[Wikipedia:Breadcrumb navigation|breadcrumb]], to assist the reader in navigating around the wiki.
<span class="toclimit-3">__TOC__</span>
==Usage==
This template should be placed at the top of a page, beneath the level 1 heading (page name). As a page can have several categories, it's best to use the 'best fit' or most logical for the article in question.
<pre>
{{Header|First-level category|Second-level category|Third-level category|etc.}}
</pre>


## Main Index Category ##
===Parameters===
--><span style="padding: 9px">[[:Category:Main|<span style="color: #{{#ifeq:{{{1|}}}|Community|C1D6DD|{{#ifeq:{{{1|}}}|PZwiki|C1D6DD|{{#ifeq:{{PAGENAME}}|Community|EBF3F4|{{#ifeq:{{PAGENAME}}|PZwiki|C1D6DD|DDD6C1}}}}}}}};>Main Index</span>]]</span>{{#if:{{{1|}}}|<small>></small><!--
;<code>1</code> - <code>6</code>
:The name of each category leading up to the page, omitting <code>Category:</code>. The page will be added to the last category in the list, or the {{ll|:Category:Main|top-level category}} of the wiki if all parameters are empty.
;<code>hidecat</code>
:If not empty the template will not add the page to the categories defined in <code>1</code> to <code>6</code>.


## First Category ##
===Background color===
--><span style="padding: 9px">[[:Category:{{{1}}}{{!}}<span style="color: #{{#ifeq:{{{1|}}}|Community|C1D6DD|{{#ifeq:{{{1|}}}|PZwiki|C1D6DD|{{#ifeq:{{PAGENAME}}|Community|EBF3F4|{{#ifeq:{{PAGENAME}}|PZwiki|C1D6DD|DDD6C1}}}}}}}};>{{{1}}}</span>]]</span>|}}{{#if:{{{2|}}}|<small>></small><!--
The background color will be set automatically based on the category in the first level (<code>1</code>).


## Second Category ##
====Red (default)====
--><span style="padding: 9px">[[:Category:{{{2}}}{{!}}<span style="color: #{{#ifeq:{{{1|}}}|Community|C1D6DD|{{#ifeq:{{{1|}}}|PZwiki|C1D6DD|{{#ifeq:{{PAGENAME}}|Community|EBF3F4|{{#ifeq:{{PAGENAME}}|PZwiki|C1D6DD|DDD6C1}}}}}}}};>{{{2}}}</span>]]</span>|}}{{#if:{{{3|}}}|<small>></small><!--
<div style="width:32px; height:32px; background-color:var(--color-red); border:var(--border-red); border-radius:var(--border-radius)"> </div>


## Third Category ##
====Blue (community)====
--><span style="padding: 9px">[[:Category:{{{3}}}{{!}}<span style="color: #{{#ifeq:{{{1|}}}|Community|C1D6DD|{{#ifeq:{{{1|}}}|PZwiki|C1D6DD|{{#ifeq:{{PAGENAME}}|Community|EBF3F4|{{#ifeq:{{PAGENAME}}|PZwiki|C1D6DD|DDD6C1}}}}}}}};>{{{3}}}</span>]]</span>|}}{{#if:{{{4|}}}|<small>></small><!--
<div style="width:32px; height:32px; background-color:var(--color-blue); border:var(--border-blue); border-radius:var(--border-radius)"> </div>
The following categories will result in the blue color scheme.
*{{ll|:Category:PZwiki|PZwiki}}
*{{ll|:Category:Modding|Modding}}
*{{ll|:Category:The Indie Stone|The Indie Stone}}


## Fourth Category ##
===DISPLAYTITLE magic word===
--><span style="padding: 9px">[[:Category:{{{4}}}{{!}}<span style="color: #{{#ifeq:{{{1|}}}|Community|C1D6DD|{{#ifeq:{{{1|}}}|PZwiki|C1D6DD|{{#ifeq:{{PAGENAME}}|Community|EBF3F4|{{#ifeq:{{PAGENAME}}|PZwiki|C1D6DD|DDD6C1}}}}}}}};>{{{4}}}</span>]]</span>|}}{{#if:{{{5|}}}|<small>></small><!--
The name of a page (known as the display title) can be customized using the {{tll|DISPLAYTITLE}} magic word. This template will automatically display the name of a category/page with a custom display title.


## Fifth Category ##
==Examples==
--><span style="padding: 9px">[[:Category:{{{5}}}{{!}}<span style="color: #{{#ifeq:{{{1|}}}|Community|C1D6DD|{{#ifeq:{{{1|}}}|PZwiki|C1D6DD|{{#ifeq:{{PAGENAME}}|Community|EBF3F4|{{#ifeq:{{PAGENAME}}|PZwiki|C1D6DD|DDD6C1}}}}}}}};>{{{5}}}</span>]]</span>|}}{{#if:{{{6|}}}|<small>></small><!--
Template with {{ll|:Category:Project Zomboid|<code>Project Zomboid</code>}} at the first level, resulting in a red theme.
<pre>{{Header|Project Zomboid|Items|Weapons}}</pre>
;Result:
{{Header|Project Zomboid|Items|Weapons|hidecat=true}}


## Sixth Category ##
--><span style="padding: 9px">[[:Category:{{{6}}}{{!}}<span style="color: #{{#ifeq:{{{1|}}}|Community|C1D6DD|{{#ifeq:{{{1|}}}|PZwiki|C1D6DD|{{#ifeq:{{PAGENAME}}|Community|EBF3F4|{{#ifeq:{{PAGENAME}}|PZwiki|C1D6DD|DDD6C1}}}}}}}};>{{{6}}}</span>]]</span>|}}<small>></small><!--


## Page Name ##
Template with {{ll|:Category:PZwiki|<code>PZwiki</code>}} at the first level, resulting in a blue theme.
--><span style="padding: 9px">{{#ifeq:{{NAMESPACE}}|Category|{{#if:{{{pagename|}}}|[[:{{FULLPAGENAME}}|<span style="color: #fff;>{{{pagename}}}</span>]]|[[:{{FULLPAGENAME}}{{!}}{{#getdisplaytitle:{{PAGENAME}}}}]]}}|{{#if:{{{pagename|}}}|[[{{FULLPAGENAME}}|<span style="color: #fff;>{{{pagename}}}</span>]]|[[{{FULLPAGENAME}}{{!}}{{#getdisplaytitle:{{PAGENAME}}}}]]}}}}</span><!--
<pre>{{Header|PZwiki|Site maintenance}}</pre>
;Result:
{{Header|PZwiki|Site maintenance|hidecat=true}}


## Page Version ##
{{Translation guide|<syntaxhighlight lang="html">
--><span style="float:right; padding-right: 5px; color: #fff">{{#if: {{{hidever|}}}||'''Page Updated:''' [[Version history|<span style="color: #{{#ifeq:{{{1|}}}|Community|C1D6DD|{{#ifeq:{{{1|}}}|PZwiki|C1D6DD|{{#ifeq:{{PAGENAME}}|Community|EBF3F4|{{#ifeq:{{PAGENAME}}|PZwiki|C1D6DD|DDD6C1}}}}}}}};>{{{version|Unknown Version}}}{{#if:{{{version|}}}|{{#if:{{{incver|}}}|.{{{incver|}}} }} }}</span>]]}}</span></div>
{{#switch: {{{1|}}}
  <div style="margin: 0; padding: 10px;">
| navigation = Navigation
    {{#if: {{{hidecat|}}}| |
| #default = [[Category:Incorrect template usage]]
    {{#if: {{{hidever|}}}||[[Category:{{{version|Unknown Version}}}]]}}<!--
}}
</syntaxhighlight>}}


## Categories ##
==See also==
-->{{#if: {{{6|}}}|[[Category:{{{6}}}]]|<!--
*{{ll|Template:Page version}}
-->{{#if: {{{5|}}}|[[Category:{{{5}}}]]|<!--
}}
-->{{#if: {{{4|}}}|[[Category:{{{4}}}]]|<!--
{{ll|Category:Templates}}
-->{{#if:{{{3|}}}|[[Category:{{{3}}}]]|<!--
</noinclude><includeonly><div class="header theme-{{#switch:{{{1|{{ROOTPAGENAME}}}}}|PZwiki|Community|Modding|The Indie Stone=blue|#default=red}}">
-->{{#if:{{{2|}}}|[[Category:{{{2}}}]]|<!--
  <div>{{ll|:Category:Main|{{tt|name=Header|default=Navigation|arg1=navigation}}}}:</div>
-->{{#if:{{{1|}}}|[[Category:{{{1}}}]]|}}}}}}}}}}}}}}</includeonly><noinclude>{{Languages}}{{documentation}}[[Category:Templates]]</noinclude>
  <div><!--
  -->{{#if: {{{1|}}}|{{ll|:Category:{{{1}}}|{{#if:{{lcs}}|{{#getdisplaytitle: Category:{{{1}}}{{lcs}} }}|{{{1}}}}}
  }} >&nbsp;}}{{#if: {{{2|}}}|{{ll|:Category:{{{2}}}|{{#if:{{lcs}}|{{#getdisplaytitle: Category:{{{2}}}{{lcs}} }}|{{{2}}}}}
  }} >&nbsp;}}{{#if: {{{3|}}}|{{ll|:Category:{{{3}}}|{{#if:{{lcs}}|{{#getdisplaytitle: Category:{{{3}}}{{lcs}} }}|{{{3}}}}}
  }} >&nbsp;}}{{#if: {{{4|}}}|{{ll|:Category:{{{4}}}|{{#if:{{lcs}}|{{#getdisplaytitle: Category:{{{4}}}{{lcs}} }}|{{{4}}}}}
  }} >&nbsp;}}{{#if: {{{5|}}}|{{ll|:Category:{{{5}}}|{{#if:{{lcs}}|{{#getdisplaytitle: Category:{{{5}}}{{lcs}} }}|{{{5}}}}}
  }} >&nbsp;}}{{#if: {{{6|}}}|{{ll|:Category:{{{6}}}|{{#if:{{lcs}}|{{#getdisplaytitle: Category:{{{6}}}{{lcs}} }}|{{{6}}}}}
  }} >&nbsp;}}'''{{#if:{{lcs}}|{{#getdisplaytitle: {{FULLPAGENAME}} }}|{{PAGENAME}}}}'''<!--
  --></div>
{{#if: {{{hidecat|}}}|
| {{#ifeq: {{FULLROOTPAGENAME}}|Category:Main
| <!-- if current page equals `Category:Main(/xx)`, don't add category -->
| {{ll|Category:<!--
  -->{{#if:{{{6|}}}|{{{6}}}
  |{{#if:{{{5|}}}|{{{5}}}
  |{{#if:{{{4|}}}|{{{4}}}
  |{{#if:{{{3|}}}|{{{3}}}
  |{{#if:{{{2|}}}|{{{2}}}
  |{{#if:{{{1|}}}|{{{1}}}
  |Main}} }} }} }} }} }}}}
  }}{{Language code category}} <!-- if hidecat is blank, add page to language code category -->
}}</div></includeonly>

Latest revision as of 10:37, 9 March 2024

Lock-locked.png
This page has been put into protection by a PZwiki administrator.
Only users in the sysop user group may edit this page.
Notebook.pngTemplate Documentation

This template is used to add a breadcrumb, to assist the reader in navigating around the wiki.

Usage

This template should be placed at the top of a page, beneath the level 1 heading (page name). As a page can have several categories, it's best to use the 'best fit' or most logical for the article in question.

{{Header|First-level category|Second-level category|Third-level category|etc.}}

Parameters

1 - 6
The name of each category leading up to the page, omitting Category:. The page will be added to the last category in the list, or the top-level category of the wiki if all parameters are empty.
hidecat
If not empty the template will not add the page to the categories defined in 1 to 6.

Background color

The background color will be set automatically based on the category in the first level (1).

Red (default)

Blue (community)

The following categories will result in the blue color scheme.

DISPLAYTITLE magic word

The name of a page (known as the display title) can be customized using the {{DISPLAYTITLE}} magic word. This template will automatically display the name of a category/page with a custom display title.

Examples

Template with Project Zomboid at the first level, resulting in a red theme.

{{Header|Project Zomboid|Items|Weapons}}
Result


Template with PZwiki at the first level, resulting in a blue theme.

{{Header|PZwiki|Site maintenance}}
Result

How to translate

This template is translatable.

Template code

Paste the following code into the <includeonly> tag of the translated template and translate the text after each = sign (except for #default =).

{{#switch: {{{1|}}}
| navigation = Navigation
| #default = [[Category:Incorrect template usage]]
}}

Template documentation

Copy the code wrapped in the <noinclude> tag in this template and translate the text after doc = in the {{Documentation}} template.

{{Translation guide}} template should be removed from the translated documentation.

See also

Editors can experiment in this template's sandbox.