Template:Wikiportal/OTD: Difference between revisions
Template page
More actions
Created page with "<includeonly><onlyinclude><!-- -->{{#if:{{{prefix|}}}|<!-- -->{{#switch:{{lc:{{{mode}}}}}<!-- -->|full=<!-- -->{{{{{prefix}}}/{{CURRENTDAY}} {{CURRENTMONTHNAME}}}}<!-- -->|monthly|#default=<!-- -->{{#ifexpr:{{CURRENTDAY}}>{{{articlecount|31}}}<!-- -->|{{#ifexpr:({{CURRENTDAY}} mod {{{articlecount|31}}})=0|{{{{{prefix}}}/{{{articlecount|31}}}}}|{{{{{prefix}}}/{{#expr:{{CURRENTDAY}} mod {{{articlecount|31}}}}}}}}}<!-- -->|{{{{{prefix}}}/{{CURRENTDAY}}}}<!-- -->}}<!-- -..." |
No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly><onlyinclude><!-- | <includeonly><onlyinclude><!-- | ||
-->{{#if:{{{prefix|}}}|<!-- | -->{{#if:{{{prefix|}}}|<!-- | ||
-->{{#switch:{{lc:{{{mode}}}}}<!-- | -->{{#switch:{{lc:{{{mode}}}}}<!-- | ||
-->| | -->|daily|#default=<!-- | ||
-->{{{{{prefix}}}/{{ | -->{{{{{prefix}}}/{{CURRENTMONTHNAME}} {{CURRENTDAY}}}}<!-- | ||
-->|monthly| | -->|monthly|<!-- | ||
-->{{ | -->{{{{{prefix}}}/{{CURRENTMONTHNAME}} {{CURRENTYEAR}}}}<!-- | ||
-->| | |||
--> | -->|weekly=<!-- | ||
-->{{{{{prefix}}}/Week {{CURRENTWEEK}}, {{CURRENTYEAR}}}}<!-- | |||
-->}}<!-- | -->}}<!-- | ||
-->|{{terr|"prefix" not set}}}}<!-- | -->|{{terr|"prefix" not set}}}}<!-- | ||
--></onlyinclude></includeonly> | |||
<noinclude> | |||
Template for displaying [[Datacron Database:OTD|OTD]] on [[:Category:Portals|portal pages]]. | |||
--> | Supports 1 method of selecting articles: | ||
{{ | * '''Daily rotation''': Display a rotation of 366 articles based on day of the year. | ||
[[Category:Portal templates| | |||
==Usage== | |||
<pre> | |||
{{Wikiportal/OTD | |||
|mode =daily | |||
|prefix =Wikiportal:Main/OTD | |||
}} | |||
</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/OTD", the featured articles should be named: | |||
* "Template:Wikiportal:Datacron Database/OTD/January 1" (up to "Template:Wikiportal:Datacron Database/OTD/December 31") for the daily rotation. | |||
<code>mode</code> Determines type of rotation. | |||
Available options: | |||
* '''daily''': 366-article-rotation based on day of the year. | |||
==Examples== | |||
===Daily rotation (366 articles)=== | |||
<pre> | |||
{{Wikiportal/OTD | |||
|prefix =Wikiportal:Main/OTD | |||
|mode =daily | |||
}} | |||
</pre> | |||
results in the following featured article to be displayed today: | |||
{| style="background: #DDD; border: 1px solid #AAA; width: 100%;" | |||
|- | |||
| | |||
{{Wikiportal/OTD | |||
|prefix =Wikiportal:Main/OTD | |||
|mode =daily | |||
}} | |||
|} | |||
</noinclude> | |||
</noinclude> | |||
[[Category:Portal templates|Featured article]] | |||
Latest revision as of 22:24, 19 December 2025
Template for displaying OTD on portal pages.
Supports 1 method of selecting articles:
- Daily rotation: Display a rotation of 366 articles based on day of the year.
Usage
{{Wikiportal/OTD
|mode =daily
|prefix =Wikiportal:Main/OTD
}}
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/OTD", the featured articles should be named:
- "Template:Wikiportal:Datacron Database/OTD/January 1" (up to "Template:Wikiportal:Datacron Database/OTD/December 31") for the daily rotation.
mode Determines type of rotation.
Available options:
- daily: 366-article-rotation based on day of the year.
Examples
Daily rotation (366 articles)
{{Wikiportal/OTD
|prefix =Wikiportal:Main/OTD
|mode =daily
}}
results in the following featured article to be displayed today: