User:Mainframe98/Archive/sandbox 2

This page is a Sandbox in which I can test templates and page formatting.

Please do not edit without asking, thank you. (Admins, if you find an important error, feel free to correct it. If you do, be sure you mention it on my talk page for easy tracking.)

Editors with permission
Editors listed below have permision to edit this page when necessary.
 * any Admin

May J. Carmody Formatting table

 * Feb. '67

THE SECRET OF TURTLE BAY 'Compare to list... they always DISMISS what they cannot EXPLAIN.'

Featured Article Rotation
This template cycles through a pre-defined set of articles every week (replaced every Monday). It relies on magic words  and. Can also use.

To Do

 * Create a way to display a placeholder featured article when the year has ended and no new articles have been defined. (Creating an unwanted empty section on the page.) Done!
 * Magic word  will be removed, making this essentially unnecessary.
 * Find a way to summarize articles for use in this template.
 * Converting to Lua to reduce loading time, especially because its intended use is for the main page. Currently impossible, since Lua is not installed as an extension on this wiki. (See w:c:dev:Lua templating/Converting Wikitext templates)

Main
This is the absolute basis. The article number in the curly brackets should equal the current week. 

Displaying placeholder with |#default=

 * Main article: Help:Extensions:ParserFunctions on MediaWiki

Code
{{#switch: {{CURRENTYEAR}}-{{CURRENTWEEK}} |2015-01={{{article1}}} |2015-02={{{article2}}} |2015-03={{{article3}}} |2015-04={{{article4}}} |2015-05={{{article5}}} |2015-06={{{article6}}} |2015-07={{{article7}}} |2015-08={{{article8}}} |2015-09={{{article9}}} |2015-10={{{article10}}} |2015-11={{{article11}}} |2015-12={{{article12}}} |2015-13={{{article13}}} |2015-14={{{article14}}} |2015-15={{{article15}}} |2015-16={{{article16}}} |2015-17={{{article17}}} |2015-18={{{article18}}} |2015-19={{{article19}}} |2015-20={{{article20}}} |2015-21={{{article21}}} |2015-22={{{article22}}} |2015-23={{{article23}}} |2015-24={{{article24}}} |2015-25={{{article25}}} |2015-26={{{article26}}} |2015-27={{{article27}}} |2015-28={{{article28}}} |2015-29={{{article29}}} |2015-30={{{article30}}} |2015-31={{{article31}}} |2015-32={{{article32}}} |2015-33={{{article33}}} |2015-34={{{article34}}} |2015-35={{{article35}}} |2015-36={{{article36}}} |2015-37={{{article37}}} |2015-38={{{article38}}} |2015-39={{{article39}}} |2015-40={{{article40}}} |2015-41={{{article41}}} |2015-42={{{article42}}} |2015-43={{{article43}}} |2015-44={{{article44}}} |2015-45={{{article45}}} |2015-46={{{article46}}} |2015-47={{{article47}}} |2015-48={{{article48}}} |2015-49={{{article49}}} |2015-50={{{article50}}} |2015-51={{{article51}}} |2015-52={{{article52}}} |#default={{{default article}} }}

Testing if output is empty with
This code should check if the output is empty, if so it should display a placeholder article. In other words, if the output of the base template is empty (equals zero), the thirth argument will be displayed (here, the current featured article), if there is output, nothing should be displayed (second argument). Currently unused.