Changes

Jump to navigation Jump to search

Wurmpedia editing handbook

667 bytes added, 17:39, 15 September 2020
m
Saving progress. Still working on it.
In the case of our purple unicorn, we will need a creature template, which is found here: https://wurmpedia.com/index.php/Template:Creature.
<nowiki>{{Creature|image=deer.jpg *** defaults to {{PAGENAME}}.jpg or {{PAGENAME}}.png ***|unique=yes (leave out for non-uniques)|aggro=Yes|No|Reduced|tamable=Yes|No|Unknown|dommable=Yes|No|Unknown|groomable=Yes|No|Unknown|butcheringprod=[[Meat]], [[fat]], [[tail]], [[hoof]], [[gland]], [[eye]], [[hide]], [[File:Handbook12.pngbladder]]|meattype=Game meat|ridable=Yes|No|Unknown|swim=Yes|No|Unknown|eats=Grain and seeds|lair=[[Deer Yard]]|spawn=[[Grass]], [[Steppe]]}}</nowiki>
Copy and paste from <nowiki>{{ to }}</nowiki>, then replace with your purple unicorn's information:
<nowiki>{{Creature
===Creating a Template===
Step 1: Choose a name for your template and go to create the page
===Step 1: Choose a name for your template and go to create the page.===
 
[[File:Handbook12.png]]
===Step 2: Content===
We want the template to tell pages "This is a <colour> unicorn". For the basic text, you can just add it within the tags.
To make a part show user input, it needs to be within three curly brackets {{{ and }}}. In this case, we want the user to specify the colour, so we can put <nowiki>{{{color}}}</nowiki>. Now, our text will look like this: This is a <nowiki>{{{color}}} </nowiki> unicorn.
Now, check that it works! After saving this, you can go to another article and add the template with curly brackets. In this case:
 <nowiki>{{Unicorn}}</nowiki> 
Using show preview, you will see your template content!
Great! But on this page, we want it to say "This is a purple unicorn." Since we have "color" in curly brackets, we can specify this option. To do this, you will add a new line to your template link, like so:
 
{{Unicorn
|color=purple}}
 
Now on clicking show preview, you will see:
[[File:Handbook22.png]]
 
===Step 3: Include and noinclude===
Step 3: Include and noinclude
Any content written directly into the template will show on both the template’s page as well as any pages using the template.
Any content you want to show only on pages using this template and not the template itself should be within <nowiki><includeonly></nowiki> and <nowiki></includeonly></nowiki>. This will make your code invisible on the Template page, and only visible when the template is used. <nowiki><includeonly>
This is a {{{color}}} unicorn.
</includeonly>
</nowiki>
To put information only on the Template:Unicorn page, it will need to be within <noinclude> and </noinclude> tags. This will prevent anything written in these tags from being shown on pages the template is used on. This is used to display information about your template.
</includeonly>
<nowiki><noinclude> 
This template is used on Unicorn pages and displays important text that will show you what colour the unicorn is.
</pre>
</noinclude>
</nowiki>
“If” Statements
editor
7,290

edits

Navigation menu