Template:Wikiportal/Featured article: Difference between revisions
Template page
More actions
No edit summary |
No edit summary |
||
| Line 4: | Line 4: | ||
-->{{#switch:{{lc:{{{mode}}}}}<!-- | -->{{#switch:{{lc:{{{mode}}}}}<!-- | ||
-->| | -->|daily=<!-- | ||
-->{{{{{prefix}}}/{{CURRENTDAY}} {{ | -->{{{{{prefix}}}/{{CURRENTMONTHNAME}} {{CURRENTDAY}}, {{CURRENTYEAR}}}}<!-- | ||
-->|monthly|#default=<!-- | -->|monthly|#default=<!-- | ||
--> | -->{{{{{prefix}}}/{{CURRENTMONTHNAME}} {{CURRENTYEAR}}}}<!-- | ||
-->|weekly=<!-- | -->|weekly=<!-- | ||
-->{{{{{prefix}}}/Week {{CURRENTWEEK}} {{CURRENTYEAR}}}}<!-- | -->{{{{{prefix}}}/Week {{CURRENTWEEK}}, {{CURRENTYEAR}}}}<!-- | ||
-->}}<!-- | -->}}<!-- | ||
| Line 21: | Line 18: | ||
--></onlyinclude></includeonly> | --></onlyinclude></includeonly> | ||
{{ | <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:
Weekly rotation (52 articles)
{{Wikiportal/News
|prefix =Wikiportal:Main/FA
|mode =weekly
}}
results in the following featured article to be displayed today:
Daily rotation (366 articles)
{{Wikiportal/News
|prefix =Wikiportal:Main/FA
|mode =daily
}}
results in the following featured article to be displayed today: