struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <>
Subject Theme support
Date Tue, 16 Jul 2013 09:07:34 GMT

I have been digging into Theme support in S2 and have some doubts.
First of all to use a new theme globally (via struts.ui.theme
property), theme must implement all the tags - thus can be simple
solved by copping parent's files into new theme. It's because many
tags uses ${parameters.theme} which is passed directly to Freemarker
and we cannot control path resolution any more.

ie. /template/css_xhtml/text.ftl

<#include "/${parameters.templateDir}/${parameters.theme}/controlheader.ftl" />
<#include "/${parameters.templateDir}/simple/text.ftl" />
<#include "/${parameters.templateDir}/css_xhtml/controlfooter.ftl" />

and when I want to create a new theme called myTheme, with new version
of just one tag (checkboxlist.ftl), but I will be using also text.ftl
(without modification), Freemarker will be try to load
/template/myTheme/controlheader.ftl (because of <#include/>
statement), but when the text.ftl will be changed to:

<#include "/${parameters.templateDir}/css_xhtml/controlheader.ftl" />
<#include "/${parameters.templateDir}/simple/text.ftl" />
<#include "/${parameters.templateDir}/css_xhtml/controlfooter.ftl" />

there be no problem with extending and overriding just one tag.

Does anyone know what was the idea to use ${parameters.theme} instead
of hardcoded path?

For curiosity, text.ftl contains <#--include
"/${parameters.templateDir}/css_xhtml/controlheader.ftl" / --> (as you
can see, it is commented out)

+ 48 606 323 122

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message