Hi,
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)
Regards
--
Ćukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]