Difference between revisions of "QOTD"

From Community Pnut.io Wiki
Jump to: navigation, search
m (Replaced ADN #BookClub with #WednesdayChallenge)
m (Update to remove superfluous text from Main Page)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
{{Template:Banner|'''?'''|<strong>Initial release contains only broken links and history.</strong> Current status: Random edits in progress!<br>Developed originally for the ADN Wiki, and intended to generate a pithy or useful quotation every day of the month. Useful, pnut-specific facts would be nice to show on the Main Page.}}
+
{{Template:Banner|'''?'''|<strong>Initial release.</strong> Current status: Random edits in progress!<br>Developed originally for the ADN Wiki, and intended to generate a pithy or useful quotation every day of the month. Useful, pnut-specific facts would be nice to show on the Main Page.}}
== A sample Quotation-Of-The-Day snippet for transclusion into another page ==
+
== Quotation-Of-The-Day ==
 
For the pnut.io Wiki, of course.<br>
 
For the pnut.io Wiki, of course.<br>
An example:<br>
+
A live example:<br>
 
----
 
----
 
</noinclude>
 
</noinclude>
{{#switch: {{CURRENTDAY}}
+
[[QOTD#top|'''pnut of the day''']]: {{#switch: {{CURRENTDAY}}
 
  |0=Something went wrong. Bend over.
 
  |0=Something went wrong. Bend over.
 
  |1=What's happening? [[Events|See the Events Page!]]
 
  |1=What's happening? [[Events|See the Events Page!]]

Revision as of 20:58, 14 October 2017


?

Initial release. Current status: Random edits in progress!
Developed originally for the ADN Wiki, and intended to generate a pithy or useful quotation every day of the month. Useful, pnut-specific facts would be nice to show on the Main Page.

Quotation-Of-The-Day

For the pnut.io Wiki, of course.
A live example:


pnut of the day: The pnut.io Wiki has pages that need work.



It uses code like the following, the middle is removed for brevity:

{{#switch: {{CURRENTDAY}}
 |0=Something went wrong. Bend over.
 |1=What's happening? [[Events|This is.]]
 ...
 |31=The pnut.io Wiki has [[ToDo|pages that need work.]]
 |32=Something went wrong. Hands up!
}}

The 'switch' command uses a system variable 'CURRENTDAY' and looks through a list of entries starting with a "|" and a number which corresponds to the CURRENTDAY of the month. '0' and '32' are superfluous.