Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Wikiportal/Featured article: Difference between revisions

Template page
No edit summary
No edit summary
 
Line 4: Line 4:
-->{{#switch:{{lc:{{{mode}}}}}<!--
-->{{#switch:{{lc:{{{mode}}}}}<!--


-->|full=<!--
-->|daily=<!--
-->{{{{{prefix}}}/{{CURRENTDAY}} {{CURRENTMONTHNAME}}}}<!--
-->{{{{{prefix}}}/{{CURRENTMONTHNAME}} {{CURRENTDAY}}, {{CURRENTYEAR}}}}<!--


-->|monthly|#default=<!--
-->|monthly|#default=<!--
-->{{#ifexpr:{{CURRENTDAY}}>{{{articlecount|31}}}<!--
-->{{{{{prefix}}}/{{CURRENTMONTHNAME}} {{CURRENTYEAR}}}}<!--
-->|{{#ifexpr:({{CURRENTDAY}} mod {{{articlecount|31}}})=0|{{{{{prefix}}}/{{{articlecount|31}}}}}|{{{{{prefix}}}/{{#expr:{{CURRENTDAY}} mod {{{articlecount|31}}}}}}}}}<!--
-->|{{{{{prefix}}}/{{CURRENTDAY}}}}<!--
-->}}<!--


-->|weekly=<!--
-->|weekly=<!--
-->{{{{{prefix}}}/Week {{CURRENTWEEK}} {{CURRENTYEAR}}}}<!--
-->{{{{{prefix}}}/Week {{CURRENTWEEK}}, {{CURRENTYEAR}}}}<!--


-->}}<!--
-->}}<!--
Line 21: Line 18:


--></onlyinclude></includeonly>
--></onlyinclude></includeonly>
{{Documentation}}
<noinclude>
Template for displaying [[Datacron Database:News|News]] on [[:Category:Portals|portal pages]].
 
Supports 3 methods of selecting articles:
* '''Daily rotation''': Display a rotation of 366 articles based on day of the year.
* '''Weekly rotation''': Display a rotation of 12 articles based on week of the year.
* '''Monthly rotation''': Display a rotation of 12 articles based on month of the year.
 
 
==Usage==
<pre>
{{Wikiportal/FA
|mode        =monthly
|prefix      =Wikiportal:Main/FA
}}
</pre>
 
The featured articles should all be subpages of a certain page (specified with <code>prefix</code>).
 
===Parameters===
Name of the template (without "Template:") which the featured articles are subpages of.
 
For example, if <code>prefix</code> is set to "Wikiportal:Datacron Database/News", the featured articles should be named:
* "Template:Wikiportal:Datacron Database/FA/January 1, {{CURRENTYEAR}}" (up to "Template:Wikiportal:Datacron Database/FA/December 31, {{CURRENTYEAR}}") for the daily rotation.
* "Template:Wikiportal:Datacron Database/FA/Week 1, {{CURRENTYEAR}}" (up to "Template:Wikiportal:Datacron Database/FA/Week 52, {{CURRENTYEAR}}") for the weekly rotation.
* "Template:Wikiportal:Datacron Database/FA/January, {{CURRENTYEAR}}" (up to "Template:Wikiportal:Datacron Database/FA/December {{CURRENTYEAR}}") for the monthly rotation.
 
<code>mode</code> Determines type of rotation.
 
Available options:
* '''monthly''': 12-article-rotation based on month of the year.
* '''weekly''': 52-article-rotation based on week of the year.
* '''daily''': 366-article-rotation based on day of the year.
 
==Examples==
===Monthly rotation (31 articles)===
<pre>
{{Wikiportal/News
|prefix      =Wikiportal:Main/FA
|mode        =monthly
}}
</pre>
results in the following featured article to be displayed today:
{| style="background: #DDD; border: 1px solid #AAA; width: 100%;"
|-
|
{{Wikiportal/News
|prefix      =Wikiportal:Main/FA
|mode        =monthly
}}
|}
 
===Weekly rotation (52 articles)===
<pre>
{{Wikiportal/News
|prefix      =Wikiportal:Main/FA
|mode        =weekly
}}
</pre>
results in the following featured article to be displayed today:
{| style="background: #DDD; border: 1px solid #AAA; width: 100%;"
|-
|
{{Wikiportal/News
|prefix      =Wikiportal:Main/FA
|mode        =weekly
}}
|}
 
===Daily rotation (366 articles)===
<pre>
{{Wikiportal/News
|prefix      =Wikiportal:Main/FA
|mode        =daily
}}
</pre>
results in the following featured article to be displayed today:
{| style="background: #DDD; border: 1px solid #AAA; width: 100%;"
|-
|
{{Wikiportal/News
|prefix      =Wikiportal:Main/FA
|mode        =daily
}}
|}
</noinclude>
[[Category:Portal templates|Featured article]]
[[Category:Portal templates|Featured article]]

Latest revision as of 22:05, 19 December 2025


Template for displaying News on portal pages.

Supports 3 methods of selecting articles:

  • Daily rotation: Display a rotation of 366 articles based on day of the year.
  • Weekly rotation: Display a rotation of 12 articles based on week of the year.
  • Monthly rotation: Display a rotation of 12 articles based on month of the year.


Usage

{{Wikiportal/FA
|mode         =monthly
|prefix       =Wikiportal:Main/FA
}}

The featured articles should all be subpages of a certain page (specified with prefix).

Parameters

Name of the template (without "Template:") which the featured articles are subpages of.

For example, if prefix is set to "Wikiportal:Datacron Database/News", the featured articles should be named:

  • "Template:Wikiportal:Datacron Database/FA/January 1, 2026" (up to "Template:Wikiportal:Datacron Database/FA/December 31, 2026") for the daily rotation.
  • "Template:Wikiportal:Datacron Database/FA/Week 1, 2026" (up to "Template:Wikiportal:Datacron Database/FA/Week 52, 2026") for the weekly rotation.
  • "Template:Wikiportal:Datacron Database/FA/January, 2026" (up to "Template:Wikiportal:Datacron Database/FA/December 2026") for the monthly rotation.

mode Determines type of rotation.

Available options:

  • monthly: 12-article-rotation based on month of the year.
  • weekly: 52-article-rotation based on week of the year.
  • daily: 366-article-rotation based on day of the year.

Examples

Monthly rotation (31 articles)

{{Wikiportal/News
|prefix       =Wikiportal:Main/FA
|mode         =monthly
}}

results in the following featured article to be displayed today:

Template:Wikiportal:Main/FA/June 2026

Weekly rotation (52 articles)

{{Wikiportal/News
|prefix       =Wikiportal:Main/FA
|mode         =weekly
}}

results in the following featured article to be displayed today:

Template:Wikiportal:Main/FA/Week 24, 2026

Daily rotation (366 articles)

{{Wikiportal/News
|prefix       =Wikiportal:Main/FA
|mode         =daily
}}

results in the following featured article to be displayed today:

Template:Wikiportal:Main/FA/June 10, 2026

Cookies help us deliver our services. By using our services, you agree to our use of cookies.