Page Editing Stuff
From House of Genius
Main Page > Page Editing Stuff
Contents |
Templates
Mediawiki very nicely allows you to use special pages called templates to set up a pre-formatted look and feel to a page, and lets you plug in the data you want displayed in a very simple way. This is exceptionally useful when doing tables, because Mediawiki tables are a pain in the patoot. Setting up a template for the table means you only have to do the annoying and laborious table design once, and then you can plug in data much more easily. The basic approach is very simple.
Creating a Template
- Create a template page. The easiest way to do it is to decide on the name you want for the template, and then point your browser to:
http://www.houseofgenius.com/index.php?title=Templates:TemplateNameHere
which will take you to the blank, editable page for the template.
- Edit the template to look like whatever you want. If you want the template to have fields in it that are replaceable (very useful for things like character sheets, for instance), each field name should be enclosed in three curly brackets, like so:
Character name: {{{charname}}}
Note that the field name can be whatever you want it to be.
- Save the page when you're done.
Using a Template
To use a template on any wiki page, you just insert the template name inside two curly brackets, like so:
{{template name}}
Now, the fun part is using the template on a page. Say, for example, you want to create a character sheet for Wuxalted (and you do, because that's the only really useful template I've made so far). To do it, you'd create a page for the character. On that page, you'd insert data designed for the Wuxalted charsheet template (see below), and save the page. Doing so will automagically insert the character's stats into the template's format, and everything will be all pretty.
Inserting Data into a Template
Insert a specially-formatted list containing the field names and the field data into the page, making sure to reference the template name in the first line of the table. For example, to insert data into the Wuxalted charsheet table, enter this into the character's page:
{{Wuxalted Charsheet|
|name=Cid Fallath
|concept=Explorer, adventurer, and airship captain
|caste=Eclipse
|nature=Playful, Daring
|virtue=Temperance
|flaw=Overindulgence
|physical=2
.
.
.
}}
The first part of the above calls the template, and then each of the subsequent lines has the field name and the data to be put in the field. The data has no limit on size, and if you include wiki-style formatting, it will be properly intepreted. It is very important that you put the pipe ("|") character in front of each field name, and also that you close the list with two curly brackets.
For a good working example, look at the way Template:Wuxalted Charsheet and Cid Fallath were created to see how templates work.
This page is here as a repository for useful little bits of Wiki code and text that can be cut and pasted into your pages, so that you don't have to laboriously retype long strings of code over and over again.
Page Navigation Aids
Or "breadcrumbs," if you prefer. At the top of each page, I'd like to have a breadcrumb-trail leading people back through the steps taken to get to that page. Take a look at Shadowrun ORE to see an example of the breadcrumb trail.
It's not difficult - to create breadcrumbs, you just create links to the individual pages, with a ">" symbol connecting them. For example, the breadcrumb trail:
Main Page > Page Editing Stuff
was created by writing
[[Main Page]] > [[Page Editing Stuff]]
in the page editor window. For further specialness, I've decided that the navigation breadcrumbs should be in a small font, with a horizontal line beneath them. The breadcrumb trail at the top of this page was created by adding:
<small> [[Main Page]] > [[Page Editing Stuff]] </small> ----
See? Easy. As you edit pages - if you edit pages - and you notice that the page doesn't have a navigation bar, please add one if you can. Be aware that since the breadcrumb trails are hand-coded, they illustrate the conceptual hierarchy of the wiki; they do not show the actual sequence of clicks you just made to get where you are. That would be cool, but I don't know how to do that.
One argument against this style of navigation - from the designers of Mediawiki - is that putting in breadcrumb navigation defeats the nonhierarchical purpose of the wiki. I suppose it does. But it also makes things a bit easier. Don't feel like you need to put pages in certain places - if you feel boxed in or like, we're totally cramping your style and harshing your mellow, then attach a page on Star Wars to the Zombie War page. I don't care.
Blockquotes & Comment Boxes
For comments and discussion about the main text of a page (such as out-of-character comments in an ongoing RPG), I've put together a means to create inset "comment boxes" that clearly demarcate the comments from the primary text. These comment boxes look like:
This is a comment in a blue box.
To create the above effect, you would add the code
{{subst:cboxblue}}
before your comment, and the code
{{subst:endcbox}}
following your comment. The overall comment would then look like this:
{{subst:cboxblue}}This is a comment in a blue box.{{subst:endcbox}}
Note that technically, the "subst:cboxblue" code tells the wiki software to substitute a long string of HTML code in place of the cboxblue code--so be advised, if you use it, and then go back to edit the page, you will not see the phrase "subst:cboxblue" in the page, but rather a long string of text that looks like
<blockquote style="border: 1px dashed black; padding: 6px; background-color: #ccf"><small>
Note that there are several other colors that work quite well:
Pale green.
Pale pink.
Light gray.
Light yellow.
For the other colors, you can put cboxyellow, cboxgray, cboxpink or cboxgreen in place of cboxblue in the subst: code.
