I'm trying to run a macro within an attempt block but I'm getting an error.
macro.ftl
<#macro Content event>
This is the content
</#macro>
page.ftl
<#assign event = someHash />
<#attempt>
<#include "macro.ftl">
<@Content event=event />
<#recover>
${.error}
</#attempt>
${.error} is printing:
The following has evaluated to null or missing:===>Content [in template "macro.ftl" at line....
I don't understand why Content is null or missing? It's not a variable, it's the name of the macro I'm trying to call.
Any idea what is wrong here?
Thanks!
I've tried changing the name of the macro to something else, thinking maybe Content is reserved or something.
I've called a macro outside of an attempt block elsewhere in the file and it worked fine.
I'm expecting to see "This is the content" printed out where <@Content/> is being called.
I found my issue. I had another file with the same name in a different location, and apparently the framework I'm using found that one instead of the one I intended. When I renamed the other file, this worked as expected.