10,975
editsAd placeholder
Help:Editing manual: Difference between revisions
Jump to navigation
Jump to search
→Templates: Add section about data querying templates.
(→Templates: Add section about data querying templates.) |
|||
Line 100: | Line 100: | ||
Another great benefit of this approach is that it allows us to populate database tables with the provided information. For example, every time you add a new item to the wiki using the appropriate page template, it automatically adds the item to a database table which can be queried from elsewhere. This is, for example, how the lists on weapon type pages like [[Longswords]] are generated. | Another great benefit of this approach is that it allows us to populate database tables with the provided information. For example, every time you add a new item to the wiki using the appropriate page template, it automatically adds the item to a database table which can be queried from elsewhere. This is, for example, how the lists on weapon type pages like [[Longswords]] are generated. | ||
=== Data querying templates === | |||
When information is added to the wiki using an appropriate page creation template, the information is also made available in a database table. These tables can be queried from other pages, to display the data there as well, instead of having to link the user to the original page, or having to copy-paste the content. | |||
For example, when you visit the page of a spell that inflicts [[Bleeding (Condition)|Bleeding]], you want to see the effects of the condition right then and there, instead of having to navigate to another page. If we copy-pasted the description of the condition into every page that mentions it, we would have a lot of work to do if a patch for the game changed how the condition works! For this reason, the condition is defined once, using the [[Template:ConditionPage|Condition Page]] template, and other pages query the data to display it. | |||
Writing these queries can be quite complicated. So, the wiki offers templates that do the heavy lifting for you. A primary example is the [[Template:Condition|Condition]] template, which you provide with the name of a condition, and it queries the data for you, displaying the effects of that condition in a nice format. | |||
=== Other Templates === | === Other Templates === |