Thymeleaf: how to insert one include inside another include?

Asked

Viewed 229 times

0

I’m including a footer as follows in my home:

<div th:replace="footer :: footer"></div>

And inside the footer I need to include some overlays:

    <div th:include="overlay-terminos-condiciones"></div>
    <div th:include="overlay-protecion-datos"></div>

However I try to call in the same way as the footer and it does not work as expected, what is the correct way to call one include inside the other? They are all in the same folder, both footer.html and overlays . html.

1 answer

0

You could include inside the footer fragment two other fragments and replace this with the th:replace as done with the footer. With the th:include the fragment will be placed inside the <div> and with the replace to <div> will be completely replaced by the contents of the fragment. I hope to have helped.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.