Template:News

From Gentoo Wiki
Jump to:navigation Jump to:search
[edit

Documentation

Note
This page is a template. It contains some standardized, often used text, which can be transcluded inside other pages. As this template is widely used in our wiki, it may be protected in which case only staff members can change it. Use the discussion page to propose enhancements or fixes, or to voice your opinion.

Use this template for a news item.

Parameters

Use this template for a news item.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Idid

Add link text (HTML id attribute). Note: This can conflict with other ids on the page, so make it unique if possible. Using a unique date string such as YYYY-MM-DD for each news item as it is added to the main page should work fine. Use ISO 8601 date formatting whenever possible. If a second news item is generated in one day, append an integter number on the end of the field such as YYYY-MM-DD-2

Stringoptional
Datedate

A date string to display literally in the news.

Example
September 30, 2021
Stringrequired
Archivelinkarchivelink

Add a small link to the wiki history page to the bottom of the news item. Be aware that special characters for templates include = and |, so they will need to be escaped with {{=}} or {{!}} respectively if used in the header.

Booleanoptional
Headerheader

Add the heading. Be aware that special characters for templates include = and |, so they will need to be escaped with {{=}} or {{!}} respectively if used within the header.

Unbalanced wikitextrequired
Bodybody

Add the news text body. Be aware that special characters for templates include = and |, so they will need to be escaped with {{=}} or {{!}} respectively if used in the header.

Unbalanced wikitextrequired

Usage

See the template's testcases:





Parameter: date, header, body
Wiki code {{News|date=Aug 2, 2012|header=A header|body= This is a news item. }}

Main version

Aug 2, 2012: A heading

This is a news item.


Sandbox version

Aug 2, 2012: A heading

This is a news item.

Parameter: id, date, header, body
Wiki code {{News|id=2012-08-02|date=Aug 2, 2012|header=A header|body= This is a news item with an id attribute for linking. [[#2012-08-02|#2012-08-02]] can be used on the end of a link to page to reference this news item. }}

Main version

Aug 2, 2012: A heading

This is a news item with an id attribute for linking. #2012-08-02 can be used on the end of a link to page to reference this news item.


Sandbox version

Aug 2, 2012: A heading

This is a news item with an id attribute for linking. #2012-08-02 can be used on the end of a link to page to reference this news item.

Parameter: id, archivelink, date, header, body
Wiki code {{News|id=2012-08-02|archivelink=true|date=Aug 2, 2012|header=A header|body= This is a news item with an id attribute for linking. [[#2012-08-02|#2012-08-02]] can be used on the end of a link to page to reference this news item. }}

Main version

Aug 2, 2012: A heading

This is a news item with an id attribute for linking. #2012-08-02 can be used on the end of a link to page to reference this news item.
Wiki news archive...


Sandbox version

Aug 2, 2012: A heading

This is a news item with an id attribute for linking. #2012-08-02 can be used on the end of a link to page to reference this news item.
Wiki news archive...

Note
The above documentation is transcluded from Template:News/doc. (edit | history)
Editors can experiment in this template's sandbox (edit) and testcases (edit) pages.
Please add categories and interwikis to the /doc subpage. (See the subpages of this template.)