A macro cannot have different #nested elements, each of which will output the same text.
If you run it to have multiple variable sections in your macro, you can use the #assign element.
An example of a #macro page that allows you to define the contents of the body, header, and footer:
<#macro pageTemplate header="" footer=""> ${header} <#nested > ${footer} </#macro>
You can then define each section using the #assign element (but admittedly having multiple named #nested elements would be better).
<#assign headerContent> This is the header. </#assign> <#assign footerContent> This is the footer. </#assign> <@pageTemplate header=headerContent footer=footerContent> This is the nested content. </@pageTemplate>
The resulting result will be:
This is the header. This is the nested content. This is the footer.
Guillaume acard
source share