Editing Help:Using templates

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{hatnote|This article is an introduction to using templates. For a more technical guide, see [[Help:Templates]]. For a list of all commonly used templates, see [[Help:List of templates]].}}
{{NavWiki|help}}
{{NavWiki|help}}
A '''template''' is a special type of page designed to be embedded within other pages, providing editors  with access to consistent design and formatting.
{{hatnote|This article is a beginner friendly introduction to templates. For a more technical guide, see [[Help:Templates]].}}
A '''Template''' is a special type of page designed to be embedded within other pages, providing editors  with access to consistent design and formatting.


== Adding templates to pages ==
== How to use templates ==
=== Via the visual editor ===
=== Adding templates to pages ===
==== Visual editor ====
[[File:visual_editor_template.png|right|thumb|Inserting a template with the Visual Editor]]
[[File:visual_editor_template.png|right|thumb|Inserting a template with the Visual Editor]]
Templates can be searched for and added via the toolbar above the visual editor by clicking ''Insert'', and in the dropdown box, selecting ''Templates''. Most templates can be easily inserted onto a page this way. To later edit its contents, simply click on the inserted template in the visual editor for options.
Templates can be searches for and added via the toolbar above the visual editor by clicking ''''Insert''', and in the dropdown box, selecting '''Templates'''. Most templates can be easily inserted onto a page this way. To later edit its contents, simply click on the inserted template in the visual editor for options.


=== Via the source editor ===
==== Source editor ====
Templates are added by using double brackets {{code|<nowiki>{{ ... }}</nowiki>}}. For example, the template {{code|foo}} is added by typing {{code|<nowiki>{{foo}}</nowiki>}}.
Templates are added by using double brackets ({{code|<nowiki>{{ ... }}</nowiki>}}. For example, the template {{code|moo}} is added by typing ({{code|<nowiki>moo</nowiki>}}.


A template's parameters are specified through the use of pipes {{code|<nowiki>|</nowiki>}}.
A template's parameters are specified through the use of pipes {{code|(<nowiki>|</nowiki>)}}.


* Template with one parameter:
* Template with one parameter:
Line 17: Line 18:
** Result: {{enchantment|+1}}
** Result: {{enchantment|+1}}
* Template with multiple parameters:
* Template with multiple parameters:
** Code: {{code|<nowiki>{{AttributeBlock|8|15|7|6|10|8|dex save = yes|race=Bird|hp=10}}</nowiki>}}
** Code: {{code|<nowiki>{{AttributeBlock|8|15|7|6|10|8|hp=12|dex save = yes|race=Bird|hp=10}}</nowiki>}}
** Result:
** Result:
{{AttributeBlock|8|15|7|6|10|8|dex save = yes|race=Bird|hp=10}}
{{AttributeBlock|8|15|7|6|10|8|hp=12|dex save = yes|race=Bird|hp=10}}


== Specific uses of templates ==
=== Page creation ===
=== Adding navigation to pages ===
Templates can take input in the form of standard parameters and use it to generate a pre-formatted page.
==== Hatnotes ====
 
When an article is of a similar, but distinct, subject to another, the [[Template:Hatnote|Hatnote]] template can be used to add a note at the top of an article with a link to the other article.
==== Examples ====
* [[:Template:WeaponPage]]
* [[:Template:SpellPage]]
* [[:Template:EquipmentPage]]
* [[:Template:MiscItemPage]]
* [[:Template:ConditionPage]]
 
=== Infoboxes ===
 
==== Examples ====
* [[Template:CharacterInfo]] can generate character infoboxes for Companions, NPCs, and other creatures.
 
=== Pre-formatted information ===
 
==== Examples ====
* [[Template:DamageInfo]]: can insert pre-formatted damage information.
* [[Template:DamageText]]: can insert pre-formatted damage information.
* [[Template:Action]]
* [[Template:Condition]]
* [[Template:Ability]] can add Ability Scores.
* [[Template:Class]] can add Classes.
* [[Template:SAI]] for '''S'''pell and '''A'''ction '''I'''con Links.
* [[Template: Advantage]]
 
=== Icons ===
 
==== Examples ====
* [[Template:Icon]]
* [[Template:SmallIcon]]
* [[Template:ItemIcon]]
* [[Template:RarityItem]]
 
=== Navboxes ===


==== Disambiguation pages ====
==== Examples ====
The [[Template:Disambig|Disambig]] template can be used to create disambiguation pages when there are multiple articles with the same name.


==== Navboxes ====
=== Pre-formatted text ===
Many pages on BG3Wiki makes use of "navboxes" to create navigation between pages of related topics. A full list of navboxes can be found here: [[Help:List of templates#Navboxes|Navboxes]].


=== Page creation ===
==== Examples ====
Templates can take input in the form of standard parameters and use it to generate a pre-formatted page.
* [[Template:Hatnote]]
* [[Template:Disambiguation]]


== See also ==
== See also ==
Please note that all contributions to Baldur's Gate 3 Wiki are considered to be released under the CC BY-NC-SA license, except when noted otherwise (see BG3Wiki:Copyrights for details). If you do not want your writing to be edited and redistributed at will, do not submit it here. Per our Content Rules, you are promising that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)