Help:Using templates: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
mNo edit summary
 
(10 intermediate revisions by 2 users not shown)
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}}
{{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.
A '''Template''' is a special type of page designed to be embedded within other pages, providing editors  with access to consistent design and formatting.


== How to use templates ==
== Adding templates to pages ==
=== Adding templates to pages ===
=== Via the visual editor ===
==== 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 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.
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.


==== Source editor ====
=== Via the source editor ===
Templates are added by using double brackets ({{code|<nowiki>{{ ... }}</nowiki>}}. For example, the template {{code|moo}} is added by typing ({{code|<nowiki>moo</nowiki>}}.
Templates are added by using double brackets {{code|<nowiki>{{ ... }}</nowiki>}}. For example, the template {{code|foo}} is added by typing {{code|<nowiki>{{foo}}</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 18: Line 17:
** Result: {{enchantment|+1}}
** Result: {{enchantment|+1}}
* Template with multiple parameters:
* Template with multiple parameters:
** Code: {{code|<nowiki>{{AttributeBlock|8|15|7|6|10|8|hp=12|dex save = yes|race=Bird|hp=10}}</nowiki>}}
** Code: {{code|<nowiki>{{AttributeBlock|8|15|7|6|10|8|dex save = yes|race=Bird|hp=10}}</nowiki>}}
** Result:
** Result:
{{AttributeBlock|8|15|7|6|10|8|hp=12|dex save = yes|race=Bird|hp=10}}
{{AttributeBlock|8|15|7|6|10|8|dex save = yes|race=Bird|hp=10}}


=== Page creation ===
== Specific uses of templates ==
Templates can take input in the form of standard parameters and use it to generate a pre-formatted page.
=== Adding navigation to pages ===
==== 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 ====
==== Disambiguation pages ====
* [[:Template:WeaponPage]]
The [[Template:Disambig|Disambig]] template can be used to create disambiguation pages when there are multiple articles with the same name.
* [[:Template:SpellPage]]
* [[:Template:EquipmentPage]]
* [[:Template:MiscItemPage]]
* [[:Template:ConditionPage]]


=== Infoboxes ===
==== Navboxes ====
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]].


==== Examples ====
=== Page creation ===
* [[Template:CharacterInfo]] can generate character infoboxes for Companions, NPCs, and other creatures.
Templates can take input in the form of standard parameters and use it to generate a pre-formatted page.
 
=== 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 ===
 
==== Examples ====
 
=== Pre-formatted text ===
 
==== Examples ====
* [[Template:Hatnote]]
* [[Template:Disambiguation]]


== See also ==
== See also ==

Latest revision as of 22:17, 13 April 2024

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.

Bgwiii.png IndexGuidesModdingDiscord

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[edit | edit source]

Via the visual editor[edit | edit source]

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.

Via the source editor[edit | edit source]

Templates are added by using double brackets {{ ... }}. For example, the template foo is added by typing {{foo}}.

A template's parameters are specified through the use of pipes |.

  • Template with one parameter:
    • Code: {{enchantment|+1}}
    • Result: Enchantment: + 1
  • Template with multiple parameters:
    • Code: {{AttributeBlock|8|15|7|6|10|8|dex save = yes|race=Bird|hp=10}}
    • Result:

STR

8
(-1)

DEX

15
(+2)

CON

7
(-2)

INT

6
(-2)

WIS

10

CHA

8
(-1)

Creature Race Icon.png Race

Bird

HP Icon.png Hit Points

10

Specific uses of templates[edit | edit source]

Adding navigation to pages[edit | edit source]

Hatnotes[edit | edit source]

When an article is of a similar, but distinct, subject to another, the Hatnote template can be used to add a note at the top of an article with a link to the other article.

Disambiguation pages[edit | edit source]

The Disambig template can be used to create disambiguation pages when there are multiple articles with the same name.

Navboxes[edit | edit source]

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: Navboxes.

Page creation[edit | edit source]

Templates can take input in the form of standard parameters and use it to generate a pre-formatted page.

See also[edit | edit source]