Difference between revisions of "Template:News"

From Archives of Lusternian Lore
Jump to navigation Jump to search
(I think I have this fixed for the moment.)
(Added # back in, but only displays if post is supplied. Added currently valid boards to the doc. Made blank defaults, which enabled new syntax. Added comment about where to find the template code itself.)
Line 4: Line 4:


==Syntax==
==Syntax==
<code><nowiki>{{News|<board>|<post>}}</nowiki></code>
<code><nowiki>{{News|<board>|<post>}}</nowiki>
 
<nowiki>{{news|<board>|<post>}}</nowiki>
 
<nowiki>{{news|<board>}}</nowiki>
 
<nowiki>{{news}}</nowiki></code>


<code><nowiki>{{news|<board>|<post>}}</nowiki></code>
===Parameters===
===Parameters===
NOTE: parameters must be in order
NOTE: parameters must be in order
:<code><board></code> must be the name of a Lusternia news board.
:<code><board></code> must be the name of a ''non-faction'' Lusternia news board: <code><nowiki>Public|Announce|Politics|Events|Overhaul</nowiki></code>
:<code><post></code> must be the number of a post on the news board
:<code><post></code> must be the number of a post on the news board.
 
===Returns===
===Returns===
This appears on the page as an external link of the form: <board> #<post>
This appears on the page as an external link of the form: <board> #<post>
==Example==
<code><nowiki>{{news|Events|488}}</nowiki></code> will look and function like: [https://www.lusternia.com/news/events/488/ Events #488]


==Examples==
#<code><nowiki>{{news|Events|488}}</nowiki></code> will go to Events 488 and look like: [https://www.lusternia.com/news/events/488/ Events #488]
#<code><nowiki>{{news|Announce}}</nowiki></code> will go to a page displaying the 40 most recent Announce posts and look like: [https://www.lusternia.com/news/Announce/ Announce]
#<code><nowiki>{{news}}</nowiki></code> will go to a page displaying the news boards and will appear as an auto-numbered, anonymous link: <onlyinclude>[https://www.lusternia.com/news/{{{1|}}}/{{{2|}}} {{{1|}}} {{#if:#{{{2|}}} }}]</onlyinclude>
<!-- The part between the <onlyinclude> tags in Example 3 is where all the actual template code happens. -->


<onlyinclude>
[[Category: Templates]]
[https://www.lusternia.com/news/{{{1}}}/{{{2}}} {{{1}}} {{{2}}}]
</onlyinclude>

Revision as of 22:28, 13 March 2022

This template is for easily creating external links to the Lusternia news boards.

Using this template will make maintaining these links easier. Should the URL ever need changing, all news links can be fixed by altering this template.

Syntax

{{News|<board>|<post>}}

{{news|<board>|<post>}}

{{news|<board>}}

{{news}}

Parameters

NOTE: parameters must be in order

<board> must be the name of a non-faction Lusternia news board: Public|Announce|Politics|Events|Overhaul
<post> must be the number of a post on the news board.

Returns

This appears on the page as an external link of the form: <board> #<post>

Examples

  1. {{news|Events|488}} will go to Events 488 and look like: Events #488
  2. {{news|Announce}} will go to a page displaying the 40 most recent Announce posts and look like: Announce
  3. {{news}} will go to a page displaying the news boards and will appear as an auto-numbered, anonymous link: [1]