Template:News/core: Difference between revisions
m (added int to wiki news to translate month) |
m (removed link color so it uses default (couldn't be customised per skin)) |
||
Line 148: | Line 148: | ||
-->{{#ifeq: {{{type|}}} | blog | {{#switch: {{{index|}}} | -->{{#ifeq: {{{type|}}} | blog | {{#switch: {{{index|}}} | ||
| 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/ --> | | 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/ --> | ||
| [[zomboidweb:blog/{{{link_blog|}}}{{!}}<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=" | | <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><!-- | ||
--> | --> | ||
| 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/ --> | | 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/ --> | ||
| [[zomboidweb:blog/{{{link_blog|}}}{{!}}<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=" | | <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/ --> | | 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=" | | [[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=" | | <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/ --> | | 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=" | | [[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=" | | <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/ --> | | 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=" | | [[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=" | | <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/ --> | | 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=" | | [[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=" | | <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> | --> | #default = <span style="color:red; font-weight: bold;">ERROR: blog index is null. </span> |
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}}
.