User:Embyr 75/Sandbox: Difference between revisions

From Metroid Wiki
m
→‎Template Experiments: Some ZW code. I know, I'm an unoriginal little piggie. But I'd rather be an unoriginal little piggie that makes progress than an original piggie that makes none! =D
m (→‎Template Experiments: Something to consider for the future... leave comments on talk page. Thanks, ZW. ;D)
m (→‎Template Experiments: Some ZW code. I know, I'm an unoriginal little piggie. But I'd rather be an unoriginal little piggie that makes progress than an original piggie that makes none! =D)
Line 23: Line 23:
}}
}}


<noinclude>[[Category:Navigation Templates]]</noinclude>
 
===Featured Article Rotation Template===
<!-- Change this variable to update this template. The number is the number of featured articles it has to cycle through.
 
-->{{#vardefine:NumberOfArticles|3}}<!--
 
        Do not alter any of the coding beyond this point.
        The following variable automatically determines what day of the year it is.
 
-->{{#vardefine:DayA|{{#time:z|{{CURRENTMONTHNAME}}-{{CURRENTDAY}}-{{CURRENTYEAR}}}}}}<!--
 
        The following variable determines which featured article to link to every day. Odd-numbered days will be the next featured article. Even-numbered days it will be the same article as the previous day.
 
-->{{#vardefine:TemplateA|{{#ifeq:{{#expr:{{#var:DayA}} mod 2}}|1|{{#expr:({{#var:DayA}} mod ({{#var:NumberOfArticles}}*2)+1)/2}}|{{#expr:({{#var:DayA}} mod ({{#var:NumberOfArticles}}*2))/2+1}}}}}}<!--
 
        The following code returns the featured article which was determined by the above coding, or directly shows a specific featured article.
 
-->{{#switch:{{{1|}}}
|{{Void}}={{FA/{{#var:TemplateA}}}}
{{Clear}}
|Count={{#var:NumberOfArticles}}
|#default={{FA/{{{1}}}}}
{{Clear}}
}}
 
<noinclude>
 
<h2>Purpose</h2>
This template is used to cycle through the [[Metroid Wiki:Featured Article Nomination|Featured Articles]] on the [[Main Page]]. It changes which template it points to every other day.
 
To see a listing of the Featured Articles that this template cycles through, go to the [[Metroid Wiki:Featured Article Schedule|Featured Article Schedule]]. Once this template reaches the end of this list, it starts back at the beginning.
 
<h2>Usage</h2>
Since the Main Page is normally protected, only admins and bureaucrats can use this template. There are two settings to this template.
 
<h3>Normal Cycle</h3>
Under this setting, the template will cycle through the Featured Articles as usual. To set this template to cycle normally, type this on the Main Page:
:::'''<nowiki>{{FA}}</nowiki>'''
 
<h3>Show New Featured Article</h3>
This setting will force the template to point to a certain Featured Article. This is used to display a newly Featured Article for an extended period. To force this template to point to a certain Featured Article, type this on the Main Page:
:::'''<nowiki>{{FA|</nowiki> ''Template Number'' <nowiki>}}</nowiki>'''<br>
Where "''Template Number''" is the number of the template that is the new Featured Article.
 
</noinclude>