Template:News/core: Difference between revisions
m (reduced title font size for "official") |
m (removed link color so it uses default (couldn't be customised per skin)) |
||
(11 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly>{{#ifeq: {{{type|}}} | | <noinclude> | ||
| 1 = ;{{{date|}}}:{{{text|}}} <small>[<span class="plainlinks">[{{{link|}}} {{Translation|Read more}}]</span>]</small> | {{Protection|"This template is used on the [[Project Zomboid Wiki|Main Page]] of the wiki, therefore is considered to be '''High Risk'''."}} | ||
| 2 = ;{{{date|}}}:{{{text|}}} <small>[<span class="plainlinks">[{{{link|}}} {{Translation|Read more}}]</span>]</small> | {{Documentation/sandbox|doc= | ||
| 3 = ;{{{date|}}}:{{{text|}}} <small>[<span class="plainlinks">[{{{link|}}} {{Translation|Read more}}]</span>]</small> | This is the core template used in {{tll|News}} to control all the styling. | ||
| #default = | |||
==Usage== | |||
This template has three different types, used with the <code>title</code> parameter.<br> | |||
These are: | |||
*<code>release</code> | |||
*<code>blog</code> | |||
*<code>wiki</code> | |||
===Releases=== | |||
There can be a maximum of 3 different entries, identified with the index [1 to 3]. | |||
<pre>{{News/core|type=release | |||
|index= | |||
|date= | |||
|text= | |||
|link= | |||
}}</pre> | |||
===Blogs=== | |||
There can be a maximum of 6 different entries, identified with the index [1 to 6]. | |||
<pre>{{News/core|type=blog | |||
|index= | |||
|title= | |||
|date= | |||
|text= | |||
|link_blog= | |||
}}</pre> | |||
===Wiki news=== | |||
There can be a maximum of 3 different entries, identified with the index [1 to 3]. | |||
<pre>{{News/core|type=wiki | |||
|index= | |||
|month= | |||
|day= | |||
|year= | |||
|text= | |||
}}</pre> | |||
==Parameters== | |||
Each parameter with have a different styling, depending on the <code>type</code>. | |||
;<code>type</code> | |||
:Defines the formatting and parameters used. <br>Can be either one of <code>release</code>, <code>blog</code> or <code>wiki</code>. | |||
;<code>index</code> | |||
:A unique identifier for a page to determine which template should be used. <br>Any number from 1 to 3 for <code>release</code> and <code>wiki</code>, or 1 to 6 for <code>blog</code>. | |||
;<code>title</code> | |||
:Displays the title of an article. <br>Only used with <code>blog</code>. | |||
;<code>text</code> | |||
:Used as a brief description of the article. Displayed as the announcement heading. <br>Used for all types. | |||
;<code>link</code> | |||
:External URL. Entire URL must be entered, including protocol. <br>Only used with <code>release</code> and <code>blog</code>. Will only display if <code>link_blog</code> is empty for <code>blog</code>. | |||
;<code>link_blog</code> | |||
:External URL to the blog post. Only the page name must be entered. Will automatically link to <code>projectzomboid.com/blog/news/</code>. <br>Only used with <code>blog</code>. | |||
;<code>date</code> | |||
:Used to display the date the article was published. <br>Only used with <code>release</code> and <code>blog</code>. | |||
;<code>month</code> | |||
:The month the article was published. Used in the link to [[PZwiki:News]] to determine the anchor point. <br>Only used with <code>wiki</code>. | |||
;<code>day</code> | |||
:The day (number) the article was published. Used in the link to [[PZwiki:News]] to determine the anchor point. <br>Only used with <code>wiki</code> | |||
;<code>year</code> | |||
:The year the article was published. <br>Only used with <code>wiki</code> | |||
==Examples== | |||
===Releases=== | |||
<pre>{{News/core|type=release | |||
|index=1 | |||
|date={{int:October}} 16, 2019 | |||
|text=Build 41 released to IWBUMS beta branch! | |||
|link=https://projectzomboid.com/blog/2019/10/build-41-iwbums-out/ | |||
}}</pre> | |||
:<b>Displays</b>: | |||
{{News/core|type=release | |||
|index=1 | |||
|date={{int:October}} 16, 2019 | |||
|text=Build 41 released to IWBUMS beta branch! | |||
|link=https://projectzomboid.com/blog/2019/10/build-41-iwbums-out/ | |||
}} | |||
===Blogs=== | |||
'''''Using 'link_blog'''''' | |||
<pre>{{News/core|type=blog | |||
|index=1 | |||
|title=Zedrum | |||
|date={{int:February}} 18, 2021 | |||
|text=It’s been an up and down week in terms of MP development for Build 41. Last week’s moderately successful Wednesday… | |||
|link_blog=zedrum | |||
}}</pre> | |||
:<b>Displays</b>: | |||
{{News/core|type=blog | |||
|index=1 | |||
|title=Zedrum | |||
|date={{int:February}} 18, 2021 | |||
|text=It’s been an up and down week in terms of MP development for Build 41. Last week’s moderately successful Wednesday… | |||
|link_blog=zedrum | |||
}} | |||
'''''Using 'link'''''' | |||
<pre>{{News/core|type=blog | |||
|index=1 | |||
|title=Zedrum | |||
|date={{int:February}} 18, 2021 | |||
|text=It’s been an up and down week in terms of MP development for Build 41. Last week’s moderately successful Wednesday… | |||
|link=https://projectzomboid.com/blog/news/2021/02/zedrum/ | |||
}}</pre> | |||
:<b>Displays</b>: | |||
{{News/core|type=blog | |||
|index=1 | |||
|title=Zedrum | |||
|date={{int:February}} 18, 2021 | |||
|text=It’s been an up and down week in terms of MP development for Build 41. Last week’s moderately successful Wednesday… | |||
|link=https://projectzomboid.com/blog/news/2021/02/zedrum/ | |||
}} | |||
===Wiki news=== | |||
<pre>{{News/core|type=wiki | |||
|index=1 | |||
|month=October | |||
|day=16 | |||
|year=2019 | |||
|text=It’s been several months since the last update, however a lot of both minor and major updates have been made | |||
}}</pre> | |||
:<b>Displays</b>: | |||
{{News/core|type=wiki | |||
|index=1 | |||
|month=October | |||
|day=16 | |||
|year=2019 | |||
|text=It’s been several months since the last update, however a lot of both minor and major updates have been made | |||
}} | |||
==[[Help:Translations#Translating templates|How to translate]]== | |||
This template gets some of its translations from {{tll|Translation string}}. | |||
==See also== | |||
*[[Template:News]] | |||
*[[Template:Current version]] | |||
}} | |||
{{ll|Category:Templates}} | |||
</noinclude><includeonly>{{#ifeq: {{{type|}}} | release | {{#switch: {{{index|}}} | |||
| 1 = ;{{{date|}}}:{{{text|}}} <small>[<span class="plainlinks">[{{{link|}}} {{Translation string|Read more}}]</span>]</small> | |||
| 2 = ;{{{date|}}}:{{{text|}}} <small>[<span class="plainlinks">[{{{link|}}} {{Translation string|Read more}}]</span>]</small> | |||
| 3 = ;{{{date|}}}:{{{text|}}} <small>[<span class="plainlinks">[{{{link|}}} {{Translation string|Read more}}]</span>]</small> | |||
| #default = <span style="color:red; font-weight: bold;">ERROR: release index is null. </span> | |||
}} }}<!-- | }} }}<!-- | ||
-->{{#ifeq: {{{type|}}} | | -->{{#ifeq: {{{type|}}} | blog | {{#switch: {{{index|}}} | ||
| 1 = <span class="plainlinks">[{{{link|}}} <span style=" | | 1 = {{#if:{{{link_blog|}}} <!-- checks if "link" or "link_blog" is used. "link" is any external link. "link_blog" is a link to ProjectZomboid.com/blog/ --> | ||
| 2 = <span class="plainlinks">[{{{link|}}} <span style=" | | [[zomboidweb:blog/{{{link_blog|}}}{{!}}<span style="text-transform: uppercase; font-weight: bold; font-size:110%;">{{{title|}}} ⟩ </span>]]<span style="font-size:80%;">{{{date|}}}</span><br>{{{text|}}} <small><nowiki>[</nowiki>[[zomboidweb:blog/news/{{{link_blog|}}}{{!}}{{Translation string|Read more}}]]</span>]</small> | ||
| 3 = <span class="plainlinks">[{{{link|}}} <span style=" | | <span class="plainlinks">[{{{link|}}} <span style="text-transform: uppercase; font-weight: bold; font-size:110%;">{{{title|}}} ⟩ </span>]</span><span style="font-size:80%;">{{{date|}}}</span><br>{{{text|}}} <small>[<span class="plainlinks">[{{{link|}}} {{Translation string|Read more}}]</span>]</small>}}<br><br><!-- | ||
| 4 = <span class="plainlinks">[{{{link|}}} <span style=" | --> | ||
| 5 = <span class="plainlinks">[{{{link|}}} <span style=" | | 2 = {{#if:{{{link_blog|}}} <!-- checks if "link" or "link_blog" is used. "link" is any external link. "link_blog" is a link to ProjectZomboid.com/blog/ --> | ||
| 6 = <span class="plainlinks">[{{{link|}}} <span style=" | | [[zomboidweb:blog/{{{link_blog|}}}{{!}}<span style="text-transform: uppercase; font-weight: bold; font-size:110%;">{{{title|}}} ⟩ </span>]]<span style="font-size:80%;">{{{date|}}}</span><br>{{{text|}}} <small><nowiki>[</nowiki>[[zomboidweb:blog/news/{{{link_blog|}}}{{!}}{{Translation string|Read more}}]]</span>]</small> | ||
| <span class="plainlinks">[{{{link|}}} <span style="text-transform: uppercase; font-weight: bold; font-size:110%;">{{{title|}}} ⟩ </span>]</span><span style="font-size:80%;">{{{date|}}}</span><br>{{{text|}}} <small>[<span class="plainlinks">[{{{link|}}} {{Translation string|Read more}}]</span>]</small>}}<br><br><!-- | |||
--> | |||
| 3 = {{#if:{{{link_blog|}}} <!-- checks if "link" or "link_blog" is used. "link" is any external link. "link_blog" is a link to ProjectZomboid.com/blog/ --> | |||
| [[zomboidweb:blog/{{{link_blog|}}}{{!}}<span style="text-transform: uppercase; font-weight: bold; font-size:110%;">{{{title|}}} ⟩ </span>]]<span style="font-size:80%;">{{{date|}}}</span><br>{{{text|}}} <small><nowiki>[</nowiki>[[zomboidweb:blog/news/{{{link_blog|}}}{{!}}{{Translation string|Read more}}]]</span>]</small> | |||
| <span class="plainlinks">[{{{link|}}} <span style="text-transform: uppercase; font-weight: bold; font-size:110%;">{{{title|}}} ⟩ </span>]</span><span style="font-size:80%;">{{{date|}}}</span><br>{{{text|}}} <small>[<span class="plainlinks">[{{{link|}}} {{Translation string|Read more}}]</span>]</small>}}<br><br><!-- | |||
--> | |||
| 4 = {{#if:{{{link_blog|}}} <!-- checks if "link" or "link_blog" is used. "link" is any external link. "link_blog" is a link to ProjectZomboid.com/blog/ --> | |||
| [[zomboidweb:blog/{{{link_blog|}}}{{!}}<span style="text-transform: uppercase; font-weight: bold; font-size:110%;">{{{title|}}} ⟩ </span>]]<span style="font-size:80%;">{{{date|}}}</span><br>{{{text|}}} <small><nowiki>[</nowiki>[[zomboidweb:blog/news/{{{link_blog|}}}{{!}}{{Translation string|Read more}}]]</span>]</small> | |||
| <span class="plainlinks">[{{{link|}}} <span style="text-transform: uppercase; font-weight: bold; font-size:110%;">{{{title|}}} ⟩ </span>]</span><span style="font-size:80%;">{{{date|}}}</span><br>{{{text|}}} <small>[<span class="plainlinks">[{{{link|}}} {{Translation string|Read more}}]</span>]</small>}}<br><br><!-- | |||
--> | |||
| 5 = {{#if:{{{link_blog|}}} <!-- checks if "link" or "link_blog" is used. "link" is any external link. "link_blog" is a link to ProjectZomboid.com/blog/ --> | |||
| [[zomboidweb:blog/{{{link_blog|}}}{{!}}<span style="text-transform: uppercase; font-weight: bold; font-size:110%;">{{{title|}}} ⟩ </span>]]<span style="font-size:80%;">{{{date|}}}</span><br>{{{text|}}} <small><nowiki>[</nowiki>[[zomboidweb:blog/news/{{{link_blog|}}}{{!}}{{Translation string|Read more}}]]</span>]</small> | |||
| <span class="plainlinks">[{{{link|}}} <span style="text-transform: uppercase; font-weight: bold; font-size:110%;">{{{title|}}} ⟩ </span>]</span><span style="font-size:80%;">{{{date|}}}</span><br>{{{text|}}} <small>[<span class="plainlinks">[{{{link|}}} {{Translation string|Read more}}]</span>]</small>}}<br><br><!-- | |||
--> | |||
| 6 = {{#if:{{{link_blog|}}} <!-- checks if "link" or "link_blog" is used. "link" is any external link. "link_blog" is a link to ProjectZomboid.com/blog/ --> | |||
| [[zomboidweb:blog/{{{link_blog|}}}{{!}}<span style="text-transform: uppercase; font-weight: bold; font-size:110%;">{{{title|}}} ⟩ </span>]]<span style="font-size:80%;">{{{date|}}}</span><br>{{{text|}}} <small><nowiki>[</nowiki>[[zomboidweb:blog/news/{{{link_blog|}}}{{!}}{{Translation string|Read more}}]]</span>]</small> | |||
| <span class="plainlinks">[{{{link|}}} <span style="text-transform: uppercase; font-weight: bold; font-size:110%;">{{{title|}}} ⟩ </span>]</span><span style="font-size:80%;">{{{date|}}}</span><br>{{{text|}}} <small>[<span class="plainlinks">[{{{link|}}} {{Translation string|Read more}}]</span>]</small>}}<br><br><!-- | |||
--> | #default = <span style="color:red; font-weight: bold;">ERROR: blog index is null. </span> | |||
}} }}<!-- | }} }}<!-- | ||
-->{{#ifeq: {{{type|}}} | | -->{{#ifeq: {{{type|}}} | wiki | {{#switch: {{{index|}}} | ||
| 1 = ;{{ | | 1 = ;{{int:{{{month|}}}}} {{{day|}}}, {{{year|}}}:{{{text|}}}… <small><nowiki>[</nowiki>[[PZwiki:News#{{{month|}}}_{{{year|}}}|{{Translation string|Read more}}]]]</small> | ||
| 2 = ;{{ | | 2 = ;{{int:{{{month|}}}}} {{{day|}}}, {{{year|}}}:{{{text|}}}… <small><nowiki>[</nowiki>[[PZwiki:News#{{{month|}}}_{{{year|}}}|{{Translation string|Read more}}]]]</small> | ||
| 3 = ;{{ | | 3 = ;{{int:{{{month|}}}}} {{{day|}}}, {{{year|}}}:{{{text|}}}… <small><nowiki>[</nowiki>[[PZwiki:News#{{{month|}}}_{{{year|}}}|{{Translation string|Read more}}]]]</small> | ||
| #default = | | #default = {{Error|ERROR: wiki index is null.}} | ||
}} }}</includeonly> |
Latest revision as of 03:19, 1 April 2024
This is the core template used in {{News}}
to control all the styling.
Usage
This template has three different types, used with the title
parameter.
These are:
release
blog
wiki
Releases
There can be a maximum of 3 different entries, identified with the index [1 to 3].
{{News/core|type=release |index= |date= |text= |link= }}
Blogs
There can be a maximum of 6 different entries, identified with the index [1 to 6].
{{News/core|type=blog |index= |title= |date= |text= |link_blog= }}
Wiki news
There can be a maximum of 3 different entries, identified with the index [1 to 3].
{{News/core|type=wiki |index= |month= |day= |year= |text= }}
Parameters
Each parameter with have a different styling, depending on the type
.
type
- Defines the formatting and parameters used.
Can be either one ofrelease
,blog
orwiki
. index
- A unique identifier for a page to determine which template should be used.
Any number from 1 to 3 forrelease
andwiki
, or 1 to 6 forblog
. title
- Displays the title of an article.
Only used withblog
. text
- Used as a brief description of the article. Displayed as the announcement heading.
Used for all types. link
- External URL. Entire URL must be entered, including protocol.
Only used withrelease
andblog
. Will only display iflink_blog
is empty forblog
. link_blog
- External URL to the blog post. Only the page name must be entered. Will automatically link to
projectzomboid.com/blog/news/
.
Only used withblog
. date
- Used to display the date the article was published.
Only used withrelease
andblog
. month
- The month the article was published. Used in the link to PZwiki:News to determine the anchor point.
Only used withwiki
. day
- The day (number) the article was published. Used in the link to PZwiki:News to determine the anchor point.
Only used withwiki
year
- The year the article was published.
Only used withwiki
Examples
Releases
{{News/core|type=release |index=1 |date={{int:October}} 16, 2019 |text=Build 41 released to IWBUMS beta branch! |link=https://projectzomboid.com/blog/2019/10/build-41-iwbums-out/ }}
- Displays:
- October 16, 2019
- Build 41 released to IWBUMS beta branch! [Read more]
Blogs
Using 'link_blog'
{{News/core|type=blog |index=1 |title=Zedrum |date={{int:February}} 18, 2021 |text=It’s been an up and down week in terms of MP development for Build 41. Last week’s moderately successful Wednesday… |link_blog=zedrum }}
- Displays:
Zedrum ⟩ February 18, 2021
It’s been an up and down week in terms of MP development for Build 41. Last week’s moderately successful Wednesday… [Read more]
Using 'link'
{{News/core|type=blog |index=1 |title=Zedrum |date={{int:February}} 18, 2021 |text=It’s been an up and down week in terms of MP development for Build 41. Last week’s moderately successful Wednesday… |link=https://projectzomboid.com/blog/news/2021/02/zedrum/ }}
- Displays:
Zedrum ⟩ February 18, 2021
It’s been an up and down week in terms of MP development for Build 41. Last week’s moderately successful Wednesday… [Read more]
Wiki news
{{News/core|type=wiki |index=1 |month=October |day=16 |year=2019 |text=It’s been several months since the last update, however a lot of both minor and major updates have been made }}
- Displays:
- October 16, 2019
- It’s been several months since the last update, however a lot of both minor and major updates have been made… [Read more]
How to translate
This template gets some of its translations from {{Translation string}}
.