Template:randommainpage

From Homestar Runner Wiki

(Difference between revisions)
Jump to: navigation, search
(let's add this)
(undid revision 528711; nevermind. It won't work with SWFs)
Line 1: Line 1:
-
<includeonly>[[HR:{{#setvar: Total_Main_Pages | {{#expr:  
+
<includeonly>{{#setvar: Total_Main_Pages | {{#expr:  
24 <!-- number of regular main pages                -->  + {{#setvar: Special_Main_Pages |
24 <!-- number of regular main pages                -->  + {{#setvar: Special_Main_Pages |
Line 11: Line 11:
| 3 = mainking
| 3 = mainking
-
| <!-- default --> main{{#expr: {{#var:Get_Main_Page}} - {{#var:Special_Main_Pages}}.html }}
+
| <!-- default --> main{{#expr: {{#var:Get_Main_Page}} - {{#var:Special_Main_Pages}} }}
}}</includeonly><noinclude>Returns the filename of a random main page, including the special main pages.
}}</includeonly><noinclude>Returns the filename of a random main page, including the special main pages.

Revision as of 23:53, 18 December 2007

Returns the filename of a random main page, including the special main pages.

The same value is returned for every instance of the template on a given page (the template only chooses a random number once per page).


Usage

  • {{randommainpage}}: main17
  • [[HR:{{randommainpage}}.html]]: HR:main17.html

To update

  • Increment the number of regular main pages whenever a new one is added.
  • To add a special main page, increment the appropriate number and add the filename to the lower list.
Personal tools