Difference between revisions of "Help:Templates"

From CanonBase
(Created page with "==Templates== A template is a page that can be inserted in another page. This avoids copying of information and ensures the information is identical in each page it is used. (...")
 
Line 1: Line 1:
==Templates==
+
A template is a page that can be inserted in another page. This avoids copying of information and ensures the information is identical in each page it is used. (In wiki terminology this is called Transclusion).
A template is a page that can be inserted in another page. This avoids copying of information and ensures the information is identical in each page it is used. (In wiki terminology this is called Transclusion.
 
  
 
This can be at the same time a disadvantage, because the information cannot be adapted to a specific page.
 
This can be at the same time a disadvantage, because the information cannot be adapted to a specific page.
 +
==Templates for help files==
 +
For help files, we create a template for each property. This can be inserted in the help pages describing the expected content.
  
 
===Create a template===
 
===Create a template===
Line 13: Line 14:
 
* Copy the page name from the URL add it to the main template page behind the link (this is useful to create insert references later)
 
* Copy the page name from the URL add it to the main template page behind the link (this is useful to create insert references later)
 
<pre><nowiki>Example [[template:Name of the property|Name of the property (P999)]] Name_of_the_property</nowiki></pre>
 
<pre><nowiki>Example [[template:Name of the property|Name of the property (P999)]] Name_of_the_property</nowiki></pre>
 +
 +
=== Edit a template ===
 +
Be aware that if you change a template, it will be changed in all pages it is used!
 +
 +
You can check where it is used by adding the template name in the [[Special:WhatLinksHere|what links here]] page.
 +
 +
* Go to https://canonbase.eu/wiki/Template:Properties
 +
* click the link to the page you want to edit
 +
* edit and safe
  
 
===Inserting a template===
 
===Inserting a template===

Revision as of 12:05, 7 February 2026

A template is a page that can be inserted in another page. This avoids copying of information and ensures the information is identical in each page it is used. (In wiki terminology this is called Transclusion).

This can be at the same time a disadvantage, because the information cannot be adapted to a specific page.

Templates for help files

For help files, we create a template for each property. This can be inserted in the help pages describing the expected content.

Create a template

To create a template for a property description:

Example [[template:Name of the property|Name of the property (P999)]] 
  • Safe the page, you should see now the link you created in grey (because the page does not exist yet).
  • Click the link and add the information in the standardised format and save.
  • Copy the page name from the URL add it to the main template page behind the link (this is useful to create insert references later)
Example [[template:Name of the property|Name of the property (P999)]] Name_of_the_property

Edit a template

Be aware that if you change a template, it will be changed in all pages it is used!

You can check where it is used by adding the template name in the what links here page.

Inserting a template

Example: {{Name_of_the_property}} 
  • Add specific information below the reference.

Wikidata