home
features
quick start
download
documentation
thymol files
configuration
message resources
control parameters
expression objects
thymol types
thymol API
thymol extensions
examples
sessions
say-hello
stsm example
with-dialect
extrathyme
petclinic
news
credits
user forum
issues
browser constraints
other known issues
create new issue
thymeleaf

thymoljs

thPrefix

The thPrefix parameter sets the prefix used to identify attributes for processing by Thymol.

The default value for this parameter is "th". The default value is used if not overridden.

You can override the default value by setting thPrefix directly using any of the usual mechanisms, by re-assigning in JavaScript, using a script parameter etc.

If you're using XHTML, you can also set the value indirectly by defining a prefix for the "http://www.thymeleaf.org" xml namespace in the document html element. Like this:

      <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
      ...
      </html>

You can also use the Thymol specific namespace "http://www.thymoljs.org". This namespace will not be recognised by Thymeleaf, and attributes with a prefix in this namespace will be ignored by Thymeleaf. You can use this fact if you wish to use Thymol in combination with Thymeleaf.

      <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:tl="http://www.thymoljs.org">
      ...
      </html>

In this scenario, template element attributes having the prefix "th" can be processed by Thymeleaf (as normal), and those with the prefix "tl" can be post-processed by Thymol in the browser.

The default value may be set to a different value using the thDefaultPrefix variable (see configuration section).