Šablóna:News: Rozdiel medzi revíziami

(Undo revision 13626 by Kluka (talk))
 
(4 medziľahlé úpravy od rovnakého používateľa.)
Riadok 1: Riadok 1:
{{NewsItem
+
{{#ifexpr: {{#rpos:{{PAGENAME}}|News}}+1 or {{#rpos:{{PAGENAME}}|news}}+1
 +
|{{NewsItem
 
       |title={{{title}}}
 
       |title={{{title}}}
 
       |image={{{image|}}}
 
       |image={{{image|}}}
      |image-name={{{image-name|}}}
 
 
       |when={{{when|}}}
 
       |when={{{when|}}}
       |link={{#ifexpr: {{#pos:{{PAGENAME}}|News}} >= 0 or {{#pos:{{PAGENAME}}|news}} >= 0 | {{{link|}}} | }}
+
       |link={{{link|}}}
       |link-internal={{#ifexpr: {{#pos:{{PAGENAME}}|News}} >= 0 or {{#pos:{{PAGENAME}}|news}} >= 0 |{{{link-internal|}}} | News#{{anchorencode:{{{title}}}}} }}
+
      |link-internal={{{link-internal|}}}
       |link-external={{#ifexpr: {{#pos:{{PAGENAME}}|News}} >= 0 or {{#pos:{{PAGENAME}}|news}} >= 0 |{{{link-external|}}} | }}
+
       |link-external={{{link-external|}}}
       |link-text={{#ifexpr: {{#pos:{{PAGENAME}}|News}} >= 0 or {{#pos:{{PAGENAME}}|news}} >= 0 | {{{link-text|}}} | {{{title}}} }}
+
      |link-text={{{link-text|}}}
       |text={{#ifexpr: {{#pos:{{PAGENAME}}|News}} >= 0 or {{#pos:{{PAGENAME}}|news}} >= 0 | {{{text|}}} |}}
+
      |text={{{text}}}
}}<noinclude>
+
}}
= Template:News =
+
|{{NewsItem
 +
       |title={{{title}}}
 +
      |image={{{image|}}}
 +
      |when={{{when|}}}
 +
       |link-internal=News#{{anchorencode:{{{title}}}}}
 +
      |link-text={{{title}}}
 +
       |text=
 +
}}}}<noinclude>
 +
This template generates news items that are fully displayed in the [[News]] page, and displayed in a short form (image, title, date, and a link to the full text) when transcluded, e.g., to the [[Introduction]] page.
  
This template generates news items that are fully displayed in the [[News]] page, and displayed in a stripped-down form when transcluded, e.g., to the [[Introduction]] page.
+
Actual wikitext of the news item is generated by [[Template:NewsItem]]. Template:News sets parameters of [[Template:NewsItem]] depending on the page where the news item is being displayed.
  
Actual wikitext of the news item is generated by [[Template:NewsItem]]. The present template sets its argument according to the page where the item is being displayed.
+
== Usage – Old Style ==
</noinclude>
+
<pre>{{News
 +
  | title = Title of the news piece (mandatory)
 +
  | image = Name (only!) of an illustrating image, e.g. Presentation.jpg (optional, but highly recommended)
 +
  | when = Date of the event this news piece is about, or date when the piece was published (optional)
 +
  | link = Link to event's details, either [http://example.com external] or [[Example|internal]] (optional)
 +
  | text = Text of the news piece (mandatory, keep it short and to the point)
 +
}}
 +
</pre>

Aktuálna revízia z 17:09, 24. január 2017

{{{title}}}

{{{text}}}

This template generates news items that are fully displayed in the News page, and displayed in a short form (image, title, date, and a link to the full text) when transcluded, e.g., to the Introduction page.

Actual wikitext of the news item is generated by Template:NewsItem. Template:News sets parameters of Template:NewsItem depending on the page where the news item is being displayed.

Usage – Old Style

{{News
  | title = Title of the news piece (mandatory)
  | image = Name (only!) of an illustrating image, e.g. Presentation.jpg (optional, but highly recommended)
  | when = Date of the event this news piece is about, or date when the piece was published (optional)
  | link = Link to event's details, either [http://example.com external] or [[Example|internal]] (optional)
  | text = Text of the news piece (mandatory, keep it short and to the point)
}}