You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alireza Fattahi <af...@yahoo.com> on 2013/07/09 08:24:40 UTC

Extending Template

Hi,

I want to extend the css_xhtml.

1- /WEB-INF/classes/template/mytemp
2- Put the theme.properties in it .
3- Add the parent = css_xhtml
4- Update the the struts.xml as below:
    <constant name="struts.ui.theme" value="mytemp" />
    <constant name="sstruts.ui.templateDir" value="template" />
    <constant name="struts.ui.templateSuffix" value="ftl" />

I got below error:    

--------------------------------------------------

Error reading included file template/mytemp/controlheader.ftl
The problematic instruction:
----------
==> include "/${parameters.templateDir}/${parameters.theme}/controlheader.ftl" [on line 24, column 1 in template/css_xhtml/text.ftl]
----------

Template template/mytemp/controlheader.ftl not found.

 --------------------------------------------------

I expect that every thing should go fine !! I have just extended the template, should I copy all the css_xhtml folder from struts2-core jar.

    

~Regards,
~~Alireza Fattahi

Re: Extending Template

Posted by Lukasz Lenart <lu...@apache.org>.
2013/7/9 Alireza Fattahi <af...@yahoo.com>:
> Yes it is a typo.
> I have this <constant name="struts.ui.templateDir" value="template" /> in the struts.xml

Anyway, this constant isn't needed if you don't change the default
location ("template").

Right now there is a bit mess with theme support. Basically if you
want to change theme globally you must copy all the parent templates
into the new template. You can always use theme per tag, like below:

<s:form action="save" method="post" theme="xhtml">
    <s:textfield key="personBean.firstName" />
    <s:textfield key="personBean.lastName" />
    <s:checkboxlist key="personBean.carModels"
list="carModelsAvailable" theme="KUTheme"/>
    <s:submit key="submit" />
</s:form>


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

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


Re: Extending Template

Posted by Alireza Fattahi <af...@yahoo.com>.
Yes it is a typo.
I have this <constant name="struts.ui.templateDir" value="template" /> in the struts.xml    


 
~Regards,
~~Alireza Fattahi


________________________________
 From: Lukasz Lenart <lu...@apache.org>
To: Struts Users Mailing List <us...@struts.apache.org> 
Sent: Tuesday, 9 July 2013, 11:12
Subject: Re: Extending Template
 

2013/7/9 Alireza Fattahi <af...@yahoo.com>:
> Hi,
>
> I want to extend the css_xhtml.
>
> 1- /WEB-INF/classes/template/mytemp
> 2- Put the theme.properties in it .
> 3- Add the parent = css_xhtml
> 4- Update the the struts.xml as below:
>     <constant name="struts.ui.theme" value="mytemp" />
>     <constant name="sstruts.ui.templateDir" value="template" />

is it typo here or in your code?


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

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

Re: Extending Template

Posted by Lukasz Lenart <lu...@apache.org>.
2013/7/9 Alireza Fattahi <af...@yahoo.com>:
> Hi,
>
> I want to extend the css_xhtml.
>
> 1- /WEB-INF/classes/template/mytemp
> 2- Put the theme.properties in it .
> 3- Add the parent = css_xhtml
> 4- Update the the struts.xml as below:
>     <constant name="struts.ui.theme" value="mytemp" />
>     <constant name="sstruts.ui.templateDir" value="template" />

is it typo here or in your code?


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

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