About templates: Difference between revisions

From ISSS Wiki
Jump to navigation Jump to search
m (Added missing category)
Tag: Reverted
m (Added missing category)
Tag: Reverted
Line 43: Line 43:
# '''Update the template''': If you change the content of the template, all pages that use the template will display the new content. For example, if you change the template contents to “Hi there! Welcome to this wonderful wiki.”, any page where the template was used will display the new text instead of the original one.
# '''Update the template''': If you change the content of the template, all pages that use the template will display the new content. For example, if you change the template contents to “Hi there! Welcome to this wonderful wiki.”, any page where the template was used will display the new text instead of the original one.
[[Category: Books]]
[[Category: Books]]
[[Category: Book Chapters]]

Revision as of 16:42, 24 January 2024

What are templates

MediaWiki templates are essentially pre-formatted pieces of text that can be included in other pages. They are designed to be transcluded (embedded) inside other pages.

  • Creation: You create a page in the “Template” namespace. For example, you might create a page called “Template:Welcome” with the contents: "Hello! Welcome to the wiki.".
  • Usage: You can then insert this template into any other page using the code { {Welcome}} (without the spaces). When that page is viewed, the text “Hello! Welcome to the wiki.” will appear instead of { {Welcome}}. This is called "transclusion".
  • Modification: If you change the content of the template, it will automatically update on all the pages where the template is used. For example, if you change “Template:Welcome” to say “Hi there! Welcome to this wonderful wiki.”, all pages using { {Welcome}} will now display the new message.

Available templates

Click on the different templates to view them and see the available variables.

Those templates can be used to present different types of ISSS Wiki users. Depending of the user, use the corresponding template.

Describes conferences or events about ISSS.

With those templates, you can create pages about books and their chapters.

Describes an article, can be used to describes any kind of papers, reviews, news...

Describes a software.

How to create templates

If you need to create a new template that suit the content you want to add to this wiki, here the steps to create new templates :

  1. Create a new page: The first step is to create a new page in the MediaWiki. The name of this page should be prefixed with “Template:”, assigning it to that namespace. For example, if you want to create a template named “Welcome”, you would create a page called "Template:Welcome".
  2. Add content to the template: Once the page is created, you can add the content that you want to be displayed whenever the template is used. For instance, if you add the text “Hello! Welcome to the wiki.” to your “Template:Welcome” page, you have created your first template.
  3. Use the template: To use the template, insert the code { {Welcome}} (without spaces between the braces) in any other page. When that page is viewed, the text “Hello! Welcome to the wiki.” will appear instead of { {Welcome}}. This process is called "transclusion".
  4. Update the template: If you change the content of the template, all pages that use the template will display the new content. For example, if you change the template contents to “Hi there! Welcome to this wonderful wiki.”, any page where the template was used will display the new text instead of the original one.