Thymeleaf Data Dialect

Thymeleaf Data Dialect that helps to easier write data-* attributes. Instead of th:attr="data-msg='#{my.msg}'" it is possible to do data:msg="#{my.msg}"

License

License

Categories

Categories

Data Leaf Databases
GroupId

GroupId

com.github.mxab.thymeleaf.extras
ArtifactId

ArtifactId

thymeleaf-extras-data-attribute
Last Version

Last Version

2.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Thymeleaf Data Dialect
Thymeleaf Data Dialect that helps to easier write data-* attributes. Instead of th:attr="data-msg='#{my.msg}'" it is possible to do data:msg="#{my.msg}"
Project URL

Project URL

https://github.com/mxab/thymeleaf-extras-data-attribute
Source Code Management

Source Code Management

https://github.com/mxab/thymeleaf-extras-data-attribute

Download thymeleaf-extras-data-attribute

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.mxab.thymeleaf.extras/thymeleaf-extras-data-attribute/ -->
<dependency>
    <groupId>com.github.mxab.thymeleaf.extras</groupId>
    <artifactId>thymeleaf-extras-data-attribute</artifactId>
    <version>2.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.mxab.thymeleaf.extras/thymeleaf-extras-data-attribute/
implementation 'com.github.mxab.thymeleaf.extras:thymeleaf-extras-data-attribute:2.0.1'
// https://jarcasting.com/artifacts/com.github.mxab.thymeleaf.extras/thymeleaf-extras-data-attribute/
implementation ("com.github.mxab.thymeleaf.extras:thymeleaf-extras-data-attribute:2.0.1")
'com.github.mxab.thymeleaf.extras:thymeleaf-extras-data-attribute:jar:2.0.1'
<dependency org="com.github.mxab.thymeleaf.extras" name="thymeleaf-extras-data-attribute" rev="2.0.1">
  <artifact name="thymeleaf-extras-data-attribute" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.mxab.thymeleaf.extras', module='thymeleaf-extras-data-attribute', version='2.0.1')
)
libraryDependencies += "com.github.mxab.thymeleaf.extras" % "thymeleaf-extras-data-attribute" % "2.0.1"
[com.github.mxab.thymeleaf.extras/thymeleaf-extras-data-attribute "2.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.thymeleaf : thymeleaf jar 3.0.0.RELEASE

test (2)

Group / Artifact Type Version
org.thymeleaf : thymeleaf-testing jar 3.0.0.RELEASE
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

thymeleaf-extras-data-attribute

Thymeleaf dialect for data attributes

Setup

Maven

<dependency>
    <groupId>com.github.mxab.thymeleaf.extras</groupId>
    <artifactId>thymeleaf-extras-data-attribute</artifactId>
    <version>2.0.1</version>
</dependency>

Code

templateEngine.addDialect(new DataAttributeDialect());

Usage

Source

<html>
<body data:foo="${'bar'}" data:msg="#{my.message}" >
</body>
</html>

Result

<html>
<body data-foo="bar" data-msg="Your resolved message" >
</body>
</html>

Credits

Big shout-out to @dtrunk90 who rewrote everything for Thymeleaf 3.0

Versions

Version
2.0.1
2.0
1.3
1.2
1.1