Search code examples
keycloakfreemarker

Freemarker nesting elements the wrong way


I am having an issue when using <#nested in FreeMarker

If I do:

<div style="background: white;">
    <#nested "header">
    <#nested "info">
    <#nested "form">
</div>
<div>NOT WHITE</div>

Even the div with NOT WHITE text has a white background. The div itself also gets nested inside the previous div for some reason. Can someone help me here?


Solution

  • Probably your actual nested content (which you don't show in your question) has an unclosed div. Thus the </div> you have after <#nested "from"> closes that unclosed div, and so the div that sets the white background stays open.