Common Ftl Macros
This page is meant to share all the common FTL macros that are meant to be reusable.
macros.ftl
userInterface/.../macros.ftl
has several macros that are reusable.
showAllErrors
This macro is used to display all the validations error for a page model. Usage:
<div id="allErrorsDiv" class="allErrorsDiv"> [@mifosmacros.showAllErrors "questionDefinition.*" /] </div>
newblueprintmacros.ftl
From userInterface/.../newblueprintmacros.ftl
...
mlink
Directive for filtering text with String.format() and MarkdownJ. Useful (and very specific) for parsing i18n messages containing links. Usage from .ftl page:
<p> [@mifos.mlink dest="index.ftl"][@spring.message "home.link"/][/@mifos.mlink] </p>
i18n message:
home.link=Return to the [home page](%s) to perform other activities.
rendered HTML:
Return to the <a href="index.ftl">home page</a> to perform other activities.