Difference between revisions of "Template:News message"

From Twinsuniverse
Jump to: navigation, search
(added infobox)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#ifeq: {{{date|}}}|| {{safesubst:news message|date=now|{{{1}}}}} |<nowiki/>
+
<includeonly>
=== {{safesubst:#time: j F Y - i "min" |{{{date|now}}}}} ===
+
=== {{#if:{{{date|}}}| {{#time: j F Y |{{{date}}}}} | Recently}} ===
 
__NOEDITSECTION__
 
__NOEDITSECTION__
  
* {{{1|}}}{{
+
<ul>
#if: {{{2|}}} |* {{{2}}} }}{{
+
<li>{{{1|}}}</li>{{
#if: {{{3|}}} |* {{{3}}} }}{{
+
#if: {{{2|}}} |<li>{{{2}}}</li>}}{{
#if: {{{4|}}} |* {{{4}}} }}{{
+
#if: {{{3|}}} |<li>{{{3}}}</li>}}{{
#if: {{{5|}}} |* {{{5}}} }}
+
#if: {{{4|}}} |<li>{{{4}}}</li>}}{{
}}</includeonly><noinclude>
+
#if: {{{5|}}} |<li>{{{5}}}</li>}}
This template is used to add a news message to the <nowiki>{{</nowiki>[[Template:newslist|newslist]]<nowiki>}}</nowiki> template.
+
</ul>
 +
</includeonly><noinclude>__NOTOC__{{Infobox Template
 +
|purpose=website
 +
|singletag=no
 +
|multiline=yes
 +
|gamerelated=no
 +
|suppressible=
 +
|choice=
 +
|cat1=
 +
|var1=
 +
}}
  
{{stub}}
+
Using this template, news messages can be added to the {{Templatelink|newslist}} template. Multiple (shorter) messages can be wrapped in one, which will be put in a list automatically.
  
 
==Parameters==
 
==Parameters==
Line 19: Line 29:
 
# Additional message
 
# Additional message
 
# Additional message
 
# Additional message
* '''date''': Specify a specific date for the news message (see PHP's [http://www.php.net/manual/en/function.strtotime.php strtotime()] function, defaults to "now")
+
* '''date''': Specify a specific date for the news message (see PHP's [http://www.php.net/manual/en/function.strtotime.php strtotime()] function, defaults to displaying "Recently")
  
  
==Example==
+
'''''Note:''' If '''date''' specifies an incomplete or invalid date, the missing parts will be filled in by their current values, as in "now", which depend on each last time the newslist is saved!''
 +
 
 +
==Syntax==
 +
Most commonly, the date is written on the same line as the start of the template, with the message on the following lines:
 +
<nowiki>{{news message|date=
 +
|news message
 +
}}</nowiki>
 +
 
 +
==Examples==
 +
News messages could be listed within some kind of table or bigger list, so then it would appear something like this:
 
  <nowiki>{| border="1"
 
  <nowiki>{| border="1"
  | {{news message|There has been news.|date=october 22 2012}}
+
! News messages:
 +
|-
 +
  | {{news message|date=october 22 2012
 +
      |There has been news.}}
 
|}</nowiki>
 
|}</nowiki>
  
 
:{| border="1"
 
:{| border="1"
  | {{news message|There has been news.|date=october 22 2012}}
+
! News messages:
 +
|-
 +
  | {{news message|date=october 22 2012
 +
      |There has been news.}}
 
|}
 
|}
  
[[Category:System Templates]]
+
 
 +
When multiple news messages are made, it would appear something like this:
 +
<nowiki>{| border="1"
 +
! News messages:
 +
|-
 +
| {{news message|date=1 february 2013
 +
      |This message hasn't happened yet at the time of writing.}}
 +
|-
 +
| {{news message|date=january 29 2013
 +
      |The order of the date fragments is not really important, as it will be displayed in a single format.}}
 +
|}</nowiki>
 +
 
 +
:{| border="1"
 +
! News messages:
 +
|-
 +
| {{news message|date=1 february 2013
 +
      |This message hasn't happened yet at the time of writing.}}
 +
|-
 +
| {{news message|date=january 29 2013
 +
      |The order of the date fragments is not really important, as it will be displayed in a single format.}}
 +
|}
 +
 
 +
 
 +
Or when a news message is specified with multiple shorter or long messages, it would appear something like this:
 +
<nowiki>{| border="1"
 +
! News messages:
 +
|-
 +
| {{news message|date=march 1 2013
 +
      |When Twinsen got home, he gave his lovely Zoé a kiss on her cheek, laid the newspaper on the table, and sat down. Later, Zoé asked Twinsen if there were any new interesting messages in the newspaper, at which Twinsen replied, "''Honey, I already told you. You don't have to worry any more, FunFrock is gone, we're at peace now.''"
 +
      |Zoé looked at Twinsen, and she suddenly burst into tears. "''But,''", she started, "''what about the Emperor? I fear he's going to make a move on Astrid. With those together, who knows what could happen to our schools!''"
 +
      |Twinsen closed his eyes, and sighed.}}
 +
|-
 +
| {{news message|date=february 28 2013
 +
      |Twinsen got home after work, and looks happy to Zoé. "''Dear! Guess what, I killed FunFrock!''" }}
 +
|}</nowiki>
 +
 
 +
:{| border="1"
 +
! News messages:
 +
|-
 +
| {{news message|date=march 1 2013
 +
      |When Twinsen got home, he gave his lovely Zoé a kiss on her cheek, laid the newspaper on the table, and sat down. Later, Zoé asked Twinsen if there were any new interesting messages in the newspaper, at which Twinsen replied, "''Honey, I already told you. You don't have to worry any more, FunFrock is gone, we're at peace now.''"
 +
      |Zoé looked at Twinsen, and she suddenly burst into tears. "''But,''", she started, "''what about the Emperor? I fear he's going to make a move on Astrid. With those together, who knows what could happen to our schools!''"
 +
      |Twinsen closed his eyes, and sighed.}}
 +
|-
 +
| {{news message|date=february 28 2013
 +
      |Twinsen got home after work, and looks happy to Zoé. "''Dear! Guess what, I killed FunFrock!''" }}
 +
|}
 +
 
 +
Do note, long messages should '''not break their text onto separate lines''' with space-indentation. It would cause codeblocks to appear within them, as that's how the editor works.
 +
 
 
</noinclude>
 
</noinclude>

Latest revision as of 11:18, 4 June 2014

News message
Purpose

Website [list all]

Single tag

No [list all]

Multi-line

Yes [list all]

Protected

No [list all]

Game related

No [list all]

Categorization
Categories

none [list all]

Variables
Names

none [list all]

Subpages

Using this template, news messages can be added to the {{newslist}} template. Multiple (shorter) messages can be wrapped in one, which will be put in a list automatically.

Parameters

  1. The text of the news message (fully displayed as is)
  2. Additional message
  3. Additional message
  4. Additional message
  5. Additional message
  • date: Specify a specific date for the news message (see PHP's strtotime() function, defaults to displaying "Recently")


Note: If date specifies an incomplete or invalid date, the missing parts will be filled in by their current values, as in "now", which depend on each last time the newslist is saved!

Syntax

Most commonly, the date is written on the same line as the start of the template, with the message on the following lines:

{{news message|date=
 |news message
}}

Examples

News messages could be listed within some kind of table or bigger list, so then it would appear something like this:

{| border="1"
 ! News messages:
 |-
 | {{news message|date=october 22 2012
      |There has been news.}}
|}
News messages:

22 October 2012

  • There has been news.


When multiple news messages are made, it would appear something like this:

{| border="1"
 ! News messages:
 |-
 | {{news message|date=1 february 2013
      |This message hasn't happened yet at the time of writing.}}
 |-
 | {{news message|date=january 29 2013
      |The order of the date fragments is not really important, as it will be displayed in a single format.}}
|}
News messages:

1 February 2013

  • This message hasn't happened yet at the time of writing.

29 January 2013

  • The order of the date fragments is not really important, as it will be displayed in a single format.


Or when a news message is specified with multiple shorter or long messages, it would appear something like this:

{| border="1"
 ! News messages:
 |-
 | {{news message|date=march 1 2013
      |When Twinsen got home, he gave his lovely Zoé a kiss on her cheek, laid the newspaper on the table, and sat down. Later, Zoé asked Twinsen if there were any new interesting messages in the newspaper, at which Twinsen replied, "''Honey, I already told you. You don't have to worry any more, FunFrock is gone, we're at peace now.''"
      |Zoé looked at Twinsen, and she suddenly burst into tears. "''But,''", she started, "''what about the Emperor? I fear he's going to make a move on Astrid. With those together, who knows what could happen to our schools!''"
      |Twinsen closed his eyes, and sighed.}}
 |-
 | {{news message|date=february 28 2013
      |Twinsen got home after work, and looks happy to Zoé. "''Dear! Guess what, I killed FunFrock!''" }}
|}
News messages:

1 March 2013

  • When Twinsen got home, he gave his lovely Zoé a kiss on her cheek, laid the newspaper on the table, and sat down. Later, Zoé asked Twinsen if there were any new interesting messages in the newspaper, at which Twinsen replied, "Honey, I already told you. You don't have to worry any more, FunFrock is gone, we're at peace now."
  • Zoé looked at Twinsen, and she suddenly burst into tears. "But,", she started, "what about the Emperor? I fear he's going to make a move on Astrid. With those together, who knows what could happen to our schools!"
  • Twinsen closed his eyes, and sighed.

28 February 2013

  • Twinsen got home after work, and looks happy to Zoé. "Dear! Guess what, I killed FunFrock!"

Do note, long messages should not break their text onto separate lines with space-indentation. It would cause codeblocks to appear within them, as that's how the editor works.