All template tags start with {{ and end with }}.
Some tags (for example show) are single, you use them like: {{<tag>}}
But others need opening and closing tag (for example loop): {{<tag>}} ... {{/<tag>}}
Ending blocks
To close non single block you can use:
End by tag type: {{/<tag-type>}}
Universal end block: {{//}}
End by name: {{/<block-name>}}
You can define block with name using {{<tag> -> <name>}}
Blocks
Show Block
You can show variable/expression/list etc.
{{show random integer between 1 and 5 }}{{show {_websk} }}{{show {@name} }}
HTML is escaped by default (we want to protect users from XSS), but if you want to show HTML, use:
{{show unescaped {_html}}}
By default newlines (%nl%) are replaced with <br>, but you can disable that feature in config.
Loop Block
Loop blocks work like loop statement in Skript. To show loop entity, just add {{show loop-entity}}
{{loop intenegers between 1 and 5 }}
{{show loop-entity}}
{{/loop}}
Comment Block
Context of this block is excluded from result html.
{{# <text>}}
Execute Block
This block executes specific skript expression on server.
WebSK Template System
Our template system is based on Django's. See https://docs.djangoproject.com/en/4.0/ref/templates/language/ for more info.
Basics
All template tags start with
{{
and end with}}
. Some tags (for exampleshow
) are single, you use them like:{{<tag>}}
But others need opening and closing tag (for exampleloop
):{{<tag>}} ... {{/<tag>}}
Ending blocks
To close non single block you can use:
{{/<tag-type>}}
{{//}}
{{/<block-name>}}
You can define block with name using{{<tag> -> <name>}}
Blocks
Show Block
You can show variable/expression/list etc.
{{show random integer between 1 and 5 }}
{{show {_websk} }}
{{show {@name} }}
HTML is escaped by default (we want to protect users from XSS), but if you want to show HTML, use:
{{show unescaped {_html}}}
By default newlines (
%nl%
) are replaced with<br>
, but you can disable that feature in config.Loop Block
Loop blocks work like loop statement in Skript. To show loop entity, just add
{{show loop-entity}}
Comment Block
Context of this block is excluded from result html.
{{# <text>}}
Execute Block
This block executes specific skript expression on server.
Condition Block (else, if, elseif)