adding multiple apache tiles attributes using th:include

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

adding multiple apache tiles attributes using th:include

apprentice
I'm trying to add multiple html partial templates to my layout using thymeleaf's apache tiles lib (see doc at bottom) but I'm not sure about the syntax.

Error:  org.apache.tiles.template.NoSuchAttributeException: Attribute '{cover-module, box-module, option-module}' not found.

<div id="center" tiles:include="{cover-module, box-module, option-module}">

Following works, trouble is that each one is inserted with a outer div (e.g. <div>cover module here </div> etc.), extra div's are redundant and interferes with script.

            <div id="center">
                <div tiles:include="cover-module"/>

                <div tiles:include="box-module"/>
                <div tiles:include="option-module"/>
                <div class="contain" tiles:include="time-module"/>
            </div>

How can I insert eacg partials without the surrounding extra div so that each partial is a child of div#center?

Reference: https://github.com/thymeleaf/thymeleaf-extras-tiles2
Reply | Threaded
Open this post in threaded view
|

Re: adding multiple apache tiles attributes using th:include

Metroids
Try using tiles:replace instead of tiles:include.  (I don't use apache tiles myself, but this is how the th:replace/th:include attributes work in regular thymeleaf.)
Reply | Threaded
Open this post in threaded view
|

Re: adding multiple apache tiles attributes using th:include

apprentice
Thanks