Template:Header

From PZwiki
Jump to navigation Jump to search
PZwiki:Language policy Language:

English • español • 한국어 • русский • українська • 中文(简体)

[view] [edit] [history] [purge] Template documentation
This page has been put into protection by a PZwiki administrator so that only users in the sysop user group may edit this page.

The {{Header}} template is used at the top of pages, listing all the categories leading up to the page it is on. It also contains the version the article was updated to, adding it to a version category for maintenance.

Usage

This template must be placed at the top of a page, under the {{Languages}} template, if it is present.

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

Parameters

Parameter Description Status
Category 1 1 The name of the first category leading up to the item/page, omitting Category:. This will add the page to this category if hidcat is empty. optional
Category 2 2 The name of the second category leading up to the item/page, omitting Category:. This will add the page to this category if hidcat is empty. optional
Category 3 3 The name of the third category leading up to the item/page, omitting Category:. This will add the page to this category if hidcat is empty.
Up to 6 categories can be defined (4, 5, 6).
optional
Major Version version The major Project Zomboid version this page's content is up to date to. When updating a page use Version (#). The contents of this parameter will also be categorized on the page. optional
Minor Version incver The incremental (minor) PZ version this page's content is up to date to. Used to avoid creating many categories for a single release version. optional
Hide Body hidebody If not empty the template will not display the body (background), only displaying the header. optional

Background color

The background color is automatically set based on the category in the first anonymous parameter (1).

There are currently 2 color schemes, known as: Zomboid red and Community blue. These are taken from the {{Infobox nc}} template.

Community categories

The following categories will result in the blue color scheme.

Community
PZwiki
Modding
The Indie Stone

Translating

Many parts of this template are auto-translated using the {{Translation}} template or {{DISPLAYTITLE}} magic word. It is not necessary to translate this template to a language subpage, it is sufficient to just use {{Header}}.

Translation template

Static elements can be translated in the {{Translation}} template. If they're not already present, include and translate the below. Translations go after the equals (=) sign.

| Navigation = 
| Page updated = 
| Unknown Version =

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.

Ensure you've added the language code subpage.

Examples

{{Header|Community|Modding|hidever=true}}
Will produce
Navigation: Main>Community>Modding>Header
A whole page's worth of content in here.


And

{{Header|The Game World|Items|Weapons|version=Version 41|incver=78.16}}
Will produce
Navigation: Main>The Game World>Items>Weapons>HeaderPage updated: Version 41.78.16
Another page of content in here.

FAQs

Q: Why is there a </div> missing in the template?
A: This is intentional. It means no matter what is added to the page in the future, it will be included in the template's background. It automatically stops when it reaches the footer anyway. If the background is not reaching the bottom of the page, add the {{Clear}} template to the bottom of the page.

Q: Why do I need to use version and incver when adding the page's version?
A: The reason for this is to avoid having several categories for a single release version. For example, without both we would end up with a Category:Version 36, Category:Version 36.1, 36.2, 36.3… You see where this is going.

Updated 23/10/2023. incver now included in version category.

Source

<table class="tp-header" style="clear: both; border: 1px solid #000000; background: #{{#switch:{{{1|{{ROOTPAGENAME}}}}}|Community|PZwiki|Modding|The Indie Stone={{Infobox_nc|Community}}|#default={{Infobox_nc|default}}}}; text-align: left; width: 100%;" cellspacing="0">
  <tr>
    <th style="width: 99px; padding: 6px; border-right: 1px solid #000000; color: #ffffff;">{{Translation|Navigation}}:</th>
    <th style="padding: 6px; font-weight: normal; color: #ffffff; min-width: 120px;"><!--

      ## Main Index Category - check if current page = "Category:Main"##
      -->{{#ifeq:{{FULLROOTPAGENAME}}|Category:Main<!--
        -->|'''{{Check title|{{FULLPAGENAME}}|true={{CATBASEPAGENAME}}}}'''<!--

        ## Otherwise ##
        -->|{{Header/category|{{{1}}}|Main}}<!--
        -->{{#if:{{{1|}}}|<span style="padding: 0px 9px;"><small>></small></span><!--

        ## First Category ##
        -->{{Header/category|{{{1}}}|{{{1}}}}}}}<!--
        -->{{#if:{{{2|}}}|<span style="padding: 0px 9px;"><small>></small></span><!--

        ## Second Category ##
        -->{{Header/category|{{{1}}}|{{{2}}}}}}}<!--
        -->{{#if:{{{3|}}}|<span style="padding: 0px 9px;"><small>></small></span><!--

        ## Third Category ##
        -->{{Header/category|{{{1}}}|{{{3}}}}}}}<!--
        -->{{#if:{{{4|}}}|<span style="padding: 0px 9px;"><small>></small></span><!--

        ## Fourth Category ##
        -->{{Header/category|{{{1}}}|{{{4}}}}}}}<!--
        -->{{#if:{{{5|}}}|<span style="padding: 0px 9px;"><small>></small></span><!--

        ## Fifth Category ##
        -->{{Header/category|{{{1}}}|{{{5}}}}}}}<!--
        -->{{#if:{{{6|}}}|<span style="padding: 0px 9px;"><small>></small></span><!--

        ## Sixth Category ##
        -->{{Header/category|{{{1}}}|{{{6}}}}}}}<!--
        --><span style="padding: 0px 9px;"><small>></small></span><!--

        ## Page Name ##
        -->'''{{Check title|{{FULLPAGENAME}}|true={{CATBASEPAGENAME}}}}'''<!--
    -->}}<!--
  --></th><!--

    ## Page Version ##
    --><th style="padding: 6px; text-align:right; color: #ffffff; font-weight: normal;"><!--
      --><span style="float:right; padding-right: 5px; color: #ffffff"><!--
        -->{{#if: {{{hidever|}}}||'''{{Translation|Page updated}}:''' [[Version history|<span style="color:#{{#switch:{{{1|{{ROOTPAGENAME}}}}}|Community|PZwiki|Modding|The Indie Stone={{Infobox_nc|Community|Link}}}};"><!--
          -->{{{version|{{Translation|Unknown Version}}}}}<!--
          -->{{#if:{{{version|}}}|{{#if:{{{incver|}}}|.{{{incver|}}} }} }}<!--
        --></span>]]}}<!--
      --></span><!--
    --></th>
  </tr>
</table><!--
  
## Body ##
-->{{#if:{{{hidebody|}}}||<div style="background: #{{#switch:{{{1|{{ROOTPAGENAME}}}}}|Community|PZwiki|Modding|The Indie Stone={{Infobox_nc|Community|Body}}|#default={{Infobox_nc|default|Body}}}}; border-left: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 1px solid #000000; padding: 10px; min-width: 516px;">}}<!--

## Hide Category and Version ##
-->{{#if: {{{hidecat|}}}||
  {{#if: {{{hidever|}}}||[[Category:{{#if:{{{version|}}}|{{{version}}}{{#if:{{{incver|}}}|.{{{incver}}}}}{{#ifeq:{{Language code|{{Subpage|slash=false}}}}|true||{{Subpage}}}}|Unknown Version}}]]}}<!--

  ## Categories ##
  -->{{#if:{{{6|}}}|[[Category:{{{6}}}{{Subpage}}]]
  |{{#if:{{{5|}}}|[[Category:{{{5}}}{{Subpage}}]]
  |{{#if:{{{4|}}}|[[Category:{{{4}}}{{Subpage}}]]
  |{{#if:{{{3|}}}|[[Category:{{{3}}}{{Subpage}}]]
  |{{#if:{{{2|}}}|[[Category:{{{2}}}{{Subpage}}]]
  |{{#if:{{{1|}}}|[[Category:{{{1}}}{{Subpage}}]]
  |[[Category:Main{{Subpage}}]]}} }} }} }} }} }}
}}

See also

Documentation transcluded from Template:Header/doc.
Editors can experiment in this template's sandbox (create)