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/OTD: Difference between revisions

Template page
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
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=<!--
-->}}<!--
-->{{{{{prefix}}}/Week {{CURRENTWEEK}}, {{CURRENTYEAR}}}}<!--


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


--></onlyinclude></includeonly>
--></onlyinclude></includeonly>
{{Documentation}}
<noinclude>
[[Category:Portal templates|OTD]]
Template for displaying [[Datacron Database:OTD|OTD]] 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/OTD
|mode        =monthly
|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, {{CURRENTYEAR}}" (up to "Template:Wikiportal:Datacron Database/OTD/December 31, {{CURRENTYEAR}}") for the daily rotation.
* "Template:Wikiportal:Datacron Database/OTD/Week 1, {{CURRENTYEAR}}" (up to "Template:Wikiportal:Datacron Database/OTD/Week 52, {{CURRENTYEAR}}") for the weekly rotation.
* "Template:Wikiportal:Datacron Database/OTD/January, {{CURRENTYEAR}}" (up to "Template:Wikiportal:Datacron Database/OTD/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/OTD
|prefix      =Wikiportal:Main/OTD
|mode        =monthly
}}
</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        =monthly
}}
|}
 
===Weekly rotation (52 articles)===
<pre>
{{Wikiportal/OTD
|prefix      =Wikiportal:Main/OTD
|mode        =weekly
}}
</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        =weekly
}}
|}
 
===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>
[[Category:Portal templates|Featured article]]

Revision as of 22:08, 19 December 2025


Template for displaying OTD 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/OTD
|mode         =monthly
|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, 2026" (up to "Template:Wikiportal:Datacron Database/OTD/December 31, 2026") for the daily rotation.
  • "Template:Wikiportal:Datacron Database/OTD/Week 1, 2026" (up to "Template:Wikiportal:Datacron Database/OTD/Week 52, 2026") for the weekly rotation.
  • "Template:Wikiportal:Datacron Database/OTD/January, 2026" (up to "Template:Wikiportal:Datacron Database/OTD/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/OTD
|prefix       =Wikiportal:Main/OTD
|mode         =monthly
}}

results in the following featured article to be displayed today:

Template:Wikiportal:Main/OTD/April 2026

Weekly rotation (52 articles)

{{Wikiportal/OTD
|prefix       =Wikiportal:Main/OTD
|mode         =weekly
}}

results in the following featured article to be displayed today:

Template:Wikiportal:Main/OTD/Week 17, 2026

Daily rotation (366 articles)

{{Wikiportal/OTD
|prefix       =Wikiportal:Main/OTD
|mode         =daily
}}

results in the following featured article to be displayed today:

Template:Wikiportal:Main/OTD/April 26, 2026

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