struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: struts 2.3.16 custom (sub-classed) theme issue
Date Thu, 23 Jan 2014 06:41:44 GMT
As I understand you have created a custom theme with only one template
- textarea.ftl and there isn't neither controlheader.ftl nor
controlfooter.ftl in your them?

If so, you must use ${parameters.expandTheme} instead of
${parameters.theme} to tell ThemeManager to check current theme and
then parent theme. If you add these two templates at some point,
ThemeManager will pick theme up automatically.

Another example:
If you want to only change controlheader.ftl/controlfooter.ftl (and
you don't want to touch textarea.ftl), you can simple define them in
your theme and textarea.ftl from xhtml theme will pick them up as well
(when there be no theme attribute defined, in other case, templates
from pointed out theme will be used instead).

Hope that helps :-)


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/


2014/1/22 adam brin <abrin@digitalantiquity.org>:
> This is related to WW-4145, I think.
>
> When upgrading to 2.3.16, we're receiving the following error messages for
> our locally created theme.  This theme builds off of the simple theme, but
> mostly includes "custom" controlheader and controlfooter elements. The
> issue we're seeing is that struts seems to be looking for "inherited" files
> (e.g. css.ftl from the simple theme) in our custom theme instead of the
> parent theme (in our case simple).
>
> This only happens when we use two input themes on the same page:
>
> <!-- start page -->
>
> <@s.textarea name="test2" theme="tdar"  label="test2"/>
> <@s.textarea name="test" theme="xhtml" label="test" />
>
> <!-- end page -->
>
>
>
> Our theme lives in src/main/webapps/template.  We're not overriding the
> templateDir directive anywhere.  Our theme "tdar"  contains the following
> files:
>
>    - checkbox.ftl
>    - checkboxlist.ftl
>    - controlfooter.ftl
>    - controlheader.ftl
>    - controllabel.ftl
>    - file.ftl
>    - hidden.ftl
>    - password.ftl
>    - radiomap.ftl
>    - select.ftl
>    - text.ftl
>    - textarea.ftl
>    - theme.properties
>
>
> When loading a page that uses only the textarea:
>
> <@s.textarea name="test" theme="tdar" />
>
>
> we receive the following error:
>
> Caused by: freemarker.core._MiscTemplateException: Error reading included
> file "template/~~~tdar/css.ftl":
> Template "template/~~~tdar/css.ftl" not found.
>
> The failing instruction (print stack trace for 1 more):
> ==> #include "/\${parameters.templateDir}...  [in template
> "template/simple/textarea.ftl" at line 42, column 1]
>
>
> the textarea.ftl contains:
>
> <#include
> "/${parameters.templateDir}/${parameters.theme}/controlheader.ftl"
> /><#include "/${parameters.templateDir}/simple/textarea.ftl" />
> <#include
> "/${parameters.templateDir}/${parameters.theme}/controlfooter.ftl" />
>
>
> note, I've tried change parameters.theme to parameters.expandTheme as
> documented here:
> http://struts.apache.org/release/2.3.x/docs/extending-themes.html
>
> our theme.properties contains:
>
> parent=simple
>
>
> is anyone else seeing this? Or, are we missing something with our
> configuration?
>
> thanks,
>
> adam
> _________________________________________________________
> Adam Brin
> Director of Technology, Digital Antiquity
> 480.965.1278

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message