Toggle menu
2.9K
1.9K
8
23.7K
Divinity Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Duration/doc: Difference between revisions

Template page
No edit summary
No edit summary
 
Line 1: Line 1:
== Examples ==
{{Demo|<nowiki>{{Duration|1}} {{Duration|10}}</nowiki>}}
== Code ==
{{Demo|<nowiki>[[File:Duration Icon DOS2.png|x25px]]</nowiki>}} This displays the image file (an hourglass) and sets the size as 25px.
{{Demo|<nowiki>[[File:Duration Icon DOS2.png|x25px]]</nowiki>}} This displays the image file (an hourglass) and sets the size as 25px.


{{Demo|<nowiki>Duration: {{#switch:{{{1}}}|1 = 1 turn|#default = {{{1}}} turns}}</nowiki>}}
{{Demo|<nowiki>Duration: {{#switch:{{{1}}}|1 = 1 turn|#default = {{{1}}} turns}}</nowiki>}}
<nowiki>#switch</nowiki> is a parser function from Extension:Parser Functions. If the user inputs "1", then this automatically changes their input to "1 turn". Otherwise, the default state is that whatever the user puts in (presumably a number greater than 1), their input is automatically changed to <nowiki>"{{{whatever their input number}}}</nowiki> turns".
<nowiki>#switch</nowiki> is a parser function from Extension:Parser Functions. If the user inputs "1", then this automatically changes their input to "1 turn". Otherwise, the default state is that whatever the user puts in (presumably a number greater than 1), their input is automatically changed to <nowiki>"{{{whatever their input number}}}</nowiki> turns".

Latest revision as of 10:25, 18 March 2025

Examples

{{Duration|1}} {{Duration|10}}

Duration: 1 turn Duration: 10 turns

Code

[[File:Duration Icon DOS2.png|x25px]]

This displays the image file (an hourglass) and sets the size as 25px.

Duration: {{#switch:{{{1}}}|1 = 1 turn|#default = {{{1}}} turns}}

Duration: {{{1}}} turns

#switch is a parser function from Extension:Parser Functions. If the user inputs "1", then this automatically changes their input to "1 turn". Otherwise, the default state is that whatever the user puts in (presumably a number greater than 1), their input is automatically changed to "{{{whatever their input number}}} turns".