dt:text |
data-th-text="${variable}" |
Display dynamic text in a template. |
dt:utext |
data-th-utext="${variable}" |
Display dynamic text in a template, while escaping special characters to prevent XSS attacks. |
dt:value |
data-th-value="${variable}" |
Set the value of an input field, select element, or textarea. |
dt:if |
data-th-if="${variable}" |
Conditionally include or exclude content based on a Boolean expression. |
dt:unless |
data-th-unless="${variable}" |
Conditionally exclude content based on a Boolean expression. |
dt:each |
data-th-each="item : ${item}" |
Iterate over a collection of objects and display the data for each one. |
dt:object |
data-th-object="${variable}" |
Bind form data to a specific object in the model |
dt:href |
data-th-href="@{url}" |
Dynamically set the destination URL for a hyperlink. |
dt:src |
data-th-src="@{url}" |
Dynamically set the source URL for an image or other media resource. |
dt:style |
data-th-style="${variable} == 'conditional'} ? 'true' : 'false'" |
Set the inline style for an element. |
dt:field |
data-th-field="*{name}" |
Bind form field values to a specific property of a model object. |
dt:action |
data-th-action="@{variable}" |
Specify the URL for form submissions. |
dt:classappend |
data-th-classappend="${variable} == 'conditional'} ? 'true' : 'false'" |
Specify the URL for form submissions. |
dt:attr |
data-th-attr="data-attribute=${variable}" |
Set arbitrary attributes for an element. |
dt:fragment |
data-th-fragment="${content}" |
Define a reusable fragment of HTML that can be included in multiple templates. |
dt:replace |
data-th-replace="fragment :: content" |
Replace the contents of an element with the contents of a named fragment. |
dt:include |
data-th-include="common-header :: header" |
Include the contents of another template in the current template. |
dt:block |
data-th-block="title" |
Define a block of content that can be overridden by templates that extend the current template. |
dt:switch |
data-th-switch="${data}" |
Conditionally include content based on the value of a variable. |
dt:case |
data-th-case="anything" |
Conjunction with th:switch to define a case in a switch statement. |
dt:with |
data-th-with="anything" |
Expose a specific object in the model as a local variable, making it easier to access in the template. |
dt:insert |
data-th-insert="anything :: anything" |
Include the contents of another template in the current template, replacing the contents of an element with an ID that matches the name of the included template. |
dt:remove |
data-th-remove="all" |
Remove an element from the template, including its contents. |