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
No edit summary
No edit summary
Line 1: Line 1:
<includeonly><onlyinclude><!--
<includeonly><onlyinclude><!--
-->{{#if:{{{prefix|}}}|<!--
-->{{#if:{{{prefix|}}}|<!--


-->{{#switch:{{lc:{{{mode}}}}}<!--
-->{{#switch:{{lc:{{{mode}}}}}<!--


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


-->|monthly|#default=<!--
-->|monthly|<!--
-->{{{{{prefix}}}/{{CURRENTMONTHNAME}} {{CURRENTYEAR}}}}<!--
-->{{{{{prefix}}}/{{CURRENTMONTHNAME}} {{CURRENTYEAR}}}}<!--


Line 16: Line 17:


-->|{{terr|"prefix" not set}}}}<!--
-->|{{terr|"prefix" not set}}}}<!--
--></onlyinclude></includeonly>
--></onlyinclude></includeonly>
<noinclude>
<noinclude>
Template for displaying [[Datacron Database:OTD|OTD]] on [[:Category:Portals|portal pages]].
Template for displaying [[Datacron Database:OTD|OTD]] on [[:Category:Portals|portal pages]].


Supports 3 methods of selecting articles:
Supports 1 method of selecting articles:
* '''Daily rotation''': Display a rotation of 366 articles based on day of the year.
* '''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.




Line 30: Line 28:
<pre>
<pre>
{{Wikiportal/OTD
{{Wikiportal/OTD
|mode        =monthly
|mode        =daily
|prefix      =Wikiportal:Main/OTD
|prefix      =Wikiportal:Main/OTD
}}
}}
Line 41: Line 39:


For example, if <code>prefix</code> is set to "Wikiportal:Datacron Database/OTD", the featured articles should be named:
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/January 1" (up to "Template:Wikiportal:Datacron Database/OTD/December 31") 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.
<code>mode</code> Determines type of rotation.


Available options:
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.
* '''daily''': 366-article-rotation based on day of the year.
==Examples==
==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)===
===Daily rotation (366 articles)===
<pre>
<pre>
{{Wikiportal/OTD
{{Wikiportal/News
|prefix      =Wikiportal:Main/OTD
|prefix      =Wikiportal:Main/OTD
|mode        =daily
|mode        =daily
Line 98: Line 56:
|-
|-
|
|
{{Wikiportal/OTD
{{Wikiportal/News
|prefix      =Wikiportal:Main/OTD
|prefix      =Wikiportal:Main/OTD
|mode        =daily
|mode        =daily
}}
}}
|}
|}
</noinclude>
</noinclude>
</noinclude>
[[Category:Portal templates|Featured article]]
[[Category:Portal templates|Featured article]]

Revision as of 22:19, 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/News
|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.