Add 'Kentico' dialect for Thymeleaf engine #62
Labels
enhancement
groomed
The issue has been groomed and should be in a good shape.
hacktoberfest
help wanted
Motivation
Say your application needs to show an alert text box in blue or red background depending on the user’s role (admin or non-admin). You can compute this with conditional expressions on your template, but too many conditions could render your code a little bit hard to read …
Solution: create a new Thymeleaf attribute called
alertclass
and an attribute processor for it (Java code that will compute the right CSS class), and package it into your ownMyOwnDialect
Thymeleaf dialect. Add this dialect to your template engine with theth
prefix (same as the SpringStandard dialect) and you’ll now be able to useth:alertclass="${user.role}"
.(Taken from the docu.)
Design guidelines
This Thymeleaf dialect should provide various expressions and content resolvers to simplify usage of KenticoCloud objects from within Thymeleaf. This dialect can be registered by an application's Thymeleaf rendering engine, as well as should be registered in the inline linked items rendering engine provided with the SDK.
Reference
The text was updated successfully, but these errors were encountered: