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. (...")
 
 
(6 intermediate revisions by one other user not shown)
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==
 +
Canonbase uses templates to describe each property, so that the description is consistent wherever it appears in the help pages. Therefore, when a new property is created, a new template also needs to be made. This can then be inserted in the help pages for items that use the property.
  
===Create a template===
+
===Creating a template===
 
To create a template for a property description:
 
To create a template for a property description:
* Go to https://canonbase.eu/wiki/Template:Properties
+
* Go to https://canonbase.eu/wiki/Template:Properties, where all the existing templates for properties are listed.
* Add the property between double square brackets with a prefix “template:” and add the name the Pnr included after a bar.
+
* Edit this page, and add the property between double square brackets with a prefix “template:”, followed by a "bar" character, then the property name again with the property number in brackets:
 
<pre><nowiki>Example [[template:Name of the property|Name of the property (P999)]] </nowiki></pre>
 
<pre><nowiki>Example [[template:Name of the property|Name of the property (P999)]] </nowiki></pre>
* Safe the page, you should see now the link you created in grey (because the page does not exist yet).
+
* Save 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.
+
* Click the link and add the information about the property in the standardised format (see below) 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)
+
* Copy the page name from the URL (with underscores), and go back to the page listing the templates: [[Template:Properties]]
 +
* Enter edit mode, and paste the page name after the link to the property template:
 
<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>
 +
* The Name with underscores is required when inserting a reference to the property template in other help pages.
 +
 +
====The standard format for templates====
 +
 +
FIXME
 +
 +
=== Editing a template ===
 +
 +
Be aware that if you change a template, it will be changed in all pages it is used!
 +
 +
* Go to https://canonbase.eu/wiki/Template:Properties
 +
* click the link to the page you want to edit
 +
* edit and save the page, as required.
 +
 +
You can check where a template is used by going to the [[Special:WhatLinksHere|what links here]] page and searching for the template name.
 +
 +
=== Adding invisible information to a template ===
 +
 +
You can add "invisible" information, which appears on the template page itself, but does not appear in the pages where the template is used. This can be useful to provide more information about the use of the template or the property.
 +
 +
Add invisible information between a no include statement:
 +
 +
<pre><nowiki>Example <noinclude>this is invisible on the final page</noinclude></nowiki></pre>
 +
 +
This will show as "<noinclude>this is invisible on the final page</noinclude>" in the template description page, but not in the pages where the template is included.
  
 
===Inserting a template===
 
===Inserting a template===
* Go to the page https://canonbase.eu/wiki/Template:Properties
+
 
* Copy the name behind the link
+
* Go to the page [[Template:Properties]]
* Add the name between double accolades in the help page where you want it to be visible
+
* Copy the name with underscores after the link  
 +
* Add the name between double curly brackets in the help page where you want it to appear:
 
<pre><nowiki>Example: {{Name_of_the_property}} </nowiki></pre>
 
<pre><nowiki>Example: {{Name_of_the_property}} </nowiki></pre>
* Add specific information below the reference.
+
 
 +
===Using templates===
 +
 
 +
Templates are intended to be used in help pages for types of information that use general properties, to describe general information about the properties. The specific use of the property for the particular type of information then follows.
 +
 
 +
FIXME include example here
 +
 
 +
== sources ==
 +
* https://en.wikipedia.org/wiki/Help:Template
 +
* https://en.wikipedia.org/wiki/Help:Transclusion

Latest revision as of 09:45, 18 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

Canonbase uses templates to describe each property, so that the description is consistent wherever it appears in the help pages. Therefore, when a new property is created, a new template also needs to be made. This can then be inserted in the help pages for items that use the property.

Creating a template

To create a template for a property description:

  • Go to https://canonbase.eu/wiki/Template:Properties, where all the existing templates for properties are listed.
  • Edit this page, and add the property between double square brackets with a prefix “template:”, followed by a "bar" character, then the property name again with the property number in brackets:
Example [[template:Name of the property|Name of the property (P999)]] 
  • Save 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 about the property in the standardised format (see below) and save.
  • Copy the page name from the URL (with underscores), and go back to the page listing the templates: Template:Properties
  • Enter edit mode, and paste the page name after the link to the property template:
Example [[template:Name of the property|Name of the property (P999)]] Name_of_the_property
  • The Name with underscores is required when inserting a reference to the property template in other help pages.

The standard format for templates

FIXME

Editing a template

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

You can check where a template is used by going to the what links here page and searching for the template name.

Adding invisible information to a template

You can add "invisible" information, which appears on the template page itself, but does not appear in the pages where the template is used. This can be useful to provide more information about the use of the template or the property.

Add invisible information between a no include statement:

Example <noinclude>this is invisible on the final page</noinclude>

This will show as "this is invisible on the final page" in the template description page, but not in the pages where the template is included.

Inserting a template

  • Go to the page Template:Properties
  • Copy the name with underscores after the link
  • Add the name between double curly brackets in the help page where you want it to appear:
Example: {{Name_of_the_property}} 

Using templates

Templates are intended to be used in help pages for types of information that use general properties, to describe general information about the properties. The specific use of the property for the particular type of information then follows.

FIXME include example here

sources

Wikidata