Tutorial: Wiki Editing III

From ChatWars Wiki
Jump to: navigation, search

Since the last tutorial on how to edit wiki pages - specifically, regarding the new Semantic Wiki extension - we haven't been lazy. Now follows a complete tutorial on how to edit the wiki with all the fancy templates and queries and stuffs!

Why the *beautiful words* is all this hassle even needed?

It all comes down to one thing: Information duplication - or to be exact, the lack thereof. With the old system, aka: "We just make new pages and write everything we want in there - if it's an overview of a collection of other pages, the information has to be re-entered" there were many problems with errors while manually copying information, if the devs decide to change some stats or other details of the game, some pages were updated, others were forgotten - in short, there was much:

  • outdated
  • unneeded
  • and plainly wrong

information in this wiki. This entire system with properties and templates and queries and all that serves to:

  • centralize information
  • standardize the looks of tables and pages
  • makes updating information AND design of all information on the wiki MUCH easier

So there you have it - this is why this complicated system exists!

AAAAAAH! What do all these words mean?

  • Property: A value with a certain name that can be queried for. Most of the times they have a predefined type (Number or Text for example) and the wiki will yell at you for entering wrong types
  • Queries/to query: Querying for information is basically asking "Hey dear wiki, can I haz value of property XYZ?", to which the wiki will respond "Yes of course, the value is: ___" or, alternatively: " " (Yes, if you mistype/enter the wrong property name a query will result in NO OUTPUT AT ALL, so be sure to check if you have the name of the property correct). You can also query for several values at once which can either be shown as a table, a list of various kinds or with custom formatting (This custom formatting also uses templates and is the most common form you'll encounter on this wiki)
  • Template: Generally you shouldn't have to think about how the templates work, but it's still handy to know what they are: A template is a piece of wikitext that can be inserted in any article by using it's name and two curly brackets on both sides. For example the "citation needed" template can be used by writing: "{{citation needed}}" and will result in this: "[citation needed]". Those templates can either be simple ones like the Template:citation needed, or be HUGE pieces of actual code that happily fetches information from the entire wiki, parses it and displays it - the Recipe table you see on items and resources for example is a template that does just that. Most of the times the template page itself will not show what the template actually does, but instead will have a short description of it - depending on the complexity there might be additional information there.
    If a template says "designed to be used by Template XYZ", that has a reason! Most of the time there will be no documentation on how to use it, because its use is very specialised and it's already integrated in a network of other templates. BEWARE: CHANGING THOSE TEMPLATES EVEN THE SLIGHTEST BIT - EVEN JUST ADDING OR REMOVING AN EMPTY LINE - CAN RESULT IN WIDESPREAD CHANGES AND/OR ERRORS ON THE ENTIRE WIKI. If you're unsure, ask User:GrumpyGecko or User:LuGam. If THEY are unsure, better not touch it.

The juicy parts

Setting properties

Let's start small with the thing that is easiest and at the same time needed the most: setting properties.


{{#set:
| ItemID=k38
}}

That's it! Easy, isn't it?

Now, what if you want to set two properties at once?


{{#set:
| ItemID=k38
| note=Hey! I'm a handy note that tells wiki editors how finished my page is!
}}

Cool, just add another parameter - but the second parameter I chose wasn't just for demonstrating that. The "note" parameter serves a very special purpose - it isn't used in any template or page to display information about an item. What it is used for, is to show the current status of the page; take a look at Property:note and to see the status of aaaaalll the pages. Our end goal of course: get all of those notes to "finished" (IMPORTANT: Do not leave "note" empty at any time - not if the page isn't finished, not if it's finished! Even rolling with your head over the keyboard is better than leaving it empty! Which does not mean I suggest you do that of course)

Using templates

The next step is unimaginably harder - that is, not harder at all. Nearly all templates have been made to be used without any knowledge of them whatsoever, they usually fetch all their information by themselves, you don't need to do anything except actually writing "{{NAME OF THE TEMPLATE}}". But what templates are there? And what are they for? The second part is usually described within the template, but have this handy overview (List of all templates can be found at Category:Template):

  • Template:BoM* - generates a Bill of Materials (BOM) of an item. Has several output modes.
  • Template:Equipment - is used to make a footer that shows an navigation overview of equippable items sorted into categories. (Currently outdated?)
  • Template:InfoOverview - shows a table with most of the information of an item. What information is displayed exactly depends mostly on what the item type is (resources will have other values displayed than equippable items), but also some properties of the items can influence what will be displayed (eg: if the item does not drop in quests, the drop info table and minimum perception level will not be shown). This template depends upon several sub-templates to generate the content for the various types of items. Keep in mind that this is a Work in Progress and not all item types have a subtemplate yet (22.08.2018: Items (Equippable), Resources, Recipes & Parts, Special Equippables (like Hiking Jar) have sub templates assigned to them, items like Potions and Scrolls don't, their pages will only show very generic info until further support)
  • Template:ItemSet* - shows to which item set a certain item belongs to - using this template on the Hunter Armor page will return a link to the Hunter Armor Set page. For this to work at least the Concept page of the set has to be finished (eg: Concept:Hunter Armor Set), ideally also the Set page itself (eg: Hunter Armor Set) (if the set page isn't created the template will still return a link to that page, but it will lead to an empty page)
  • Template:RecipeInfobox* - shows a table with information about how to craft an item - needed crafting skill, the level and of course the ingredients. Can do some more cool stuff which is described on the template page itself.
  • Template:ShowTier* - returns a more detailed/nicely formatted info on the level requirement of items (instead of just the level also with a bit of description and emoticons). Not directly intended to be used on pages (is a helper template since this function is needed in several other templates), but can be used if needed.
  • Template:UsageList - shows all items that use a certain resource in their recipe as ingredient. Uses the current page as resource, this means if used on the page Coke it will show all recipes that use coke, if used on the page Stick it will show all recipes that use sticks (can be altered if needed, contact User:LuGam)

Those are all of the Templates you'll have to use directly when writing various kinds of pages - all have a certain usecase in mind, but don't fear to use them on other pages if you find it fitting as well.

You may have noticed that some of those templates have an asterisk ("*") behind their name; This indicates that those templates usually use their own page to work with. This means that you can use them without any extra work - BUT they also have the option to be manually pointed towards a certain page! For example Template:RecipeInfobox shows the recipe of the item on whose page it currently is used on, but if you for example want to show an items recipe on another page you can use the "source" parameter to tell the template which recipe it should show. If you type {{RecipeInfobox}} on the Coke page for example it will show the recipe of Coke. But if you write {{RecipeInfoxbox|source=Purified Powder}} it will show the recipe of Purified Powder instead. For all of the templates this parameter works the same, it just overrides the template to not use the page it's used in as reference, but the page specified by the "source" parameter.

But what about the other templates? You might ask. The ones that are not that easy to use. Well... There are a bunch of templates like that - but basically all of them are designed to only be used within other templates so you don't really have to worry about them. What you REALLY don't have to worry about are any and all templates that have "Row" in their name (either that or somewhere in their description it says "is designed for formatting a query output" or something along those lines). Except you want to work with how the query outputs are designed, then do worry about those (in that case it's a good idea to ask User:LuGam about details. Also scold him for not properly commenting the code.)

Tasks

Items & Resources

The biggest task right now is setting all the item properties - a large chunk is already done; all the weapons and protective gear items (as well as capes) have their properties set - though many pages are missing details like number of wrappings needed, sale price and weight when wrapped. Many event items are still completely missing or incomplete (be it equippable items or resources) and nearly all potions/herbs are missing properties.

We tried to put ALL properties for ALL various items into EVERY item page, even if they don't apply to this exact item/resource - this means properties for drop info in items and attack/defense/mana stats in resources. This is done so that you can go into any article you want and just copy the entire {{#set: ... }} block and be good to go for any page you want. But of course as sound as the idea and our intentions were, it didn't quite work out - over time we added some new features and the pages we updated until then don't have the properties for those features, so instead take a look at a full list of all possible properties, ready for pasting. The article also contains short explanations for the properties.

One last remark on setting properties for pages: The properties are ALWAYS the ABSOLUTE LAST thing on a page.

Skills

For info on how to fill in skill properties please refer to our old post.

Item Sets

For better overview over sets of items (Like the Hunter Armor Set) there's also a bunch of automation with those. Unfortunately due to some limitations of the Semantic Wiki extension it can't be made completely automatically, so here is the gist of it: For the automated system to know which items belong to which set you have to create a Concept page. Those pages are (similar to templates) preceded by "Concept:" (eg: Concept:Hunter Armor Set). Making those pages is quite easy as you can see taking the Hunter Set as example:

{{#concept:
 [[Hunter Helmet]] OR [[Hunter Armor]] OR [[Hunter Gloves]] OR [[Hunter Boots]]
 |{{PAGENAME}}
}}

Defines all parts of the [[{{PAGENAME}}]]

[[Category:Set Concept]]

The first line after the #concept: defines which pages belong to this concept (aka to this set). Just add the names of each of the pages in this line, separated by "OR".

The next line ("|{{PAGENAME}}") is just a comment to describe what the concept is about, this inserts the text "Hunter Armor Set" since the name of the page is just that. Afterwards is a small description external of the concept structure and then it will be added to the Category "Set Concept" which should list all set concepts for easier viewing of the entire list (like Category:Template does). From the technical standpoint the set is now finished, but for viewing convenience another page should be added: The actual set overview page. This page HAS to have the EXACT SAME NAME as the concept page (just without the "Concept:" in the beginning), so for the Concept:Hunter Armor Set this would be the Hunter Armor Set page. The entire content of this page is just Template:ItemSetOverview ("{{ItemSetOverview}}"). For some item sets it might be interesting to add more information, this is done manually (at least for now) - for example for event sets like the Walker Armor Set or Zombie Armor Set information like how to acquire those items and from which event they come from can be interesting. If you notice some information missing that could be used for ALL item sets just talk to User:LuGam if this is something that could be added into a template.

FAQ

Q: HAAALP! My property changes aren't showing in the Page Preview!

A: This is unfortunately a limitation of how the system works, you'll have to save your changes before they will show.


Q: EVEN MORE HAAALP! I saved my property changes but they are still not showing up!

A: This is another unfortunate peculiarity of the Semantic Wiki internals - it keeps quite a long lived cache, so it will often show you old values. You either have to be patient, or you go to Edit -> and then take a look at the Preview of the page - this preview will ALWAYS fetch the newest values without any caching (provided you saved your changes already as discussed in the previous question) (Sometimes simple refreshing of the page works as well, but that's not always). Alternatively you can also manually purge the cache. You can either do this the easy way: Hover over "More" next to the Read/Edit/View History tabs and press "Refresh" in the pop-up menu. Or you can do it the hard way by going to the Version History of a page. Then the URL should contain "action=history" at the end of the link. Now replace "history" with "purge" and load the page. The wiki will then ask you if you want to purge the cache of this page. Press OK. The cache will be removed and rebuilt, showing the newest version of the page. Rebuilding the cache can take some time depending on the page content. If a page has many queries (or the queries have a large scope), generating the new cache can take up to 30-ish seconds, so please be patient.