Search code examples
alfrescofreemarkeralfresco-share

What does freemarker @standalone directive mean in alfresco share?


I'm seeing into alfresco default modules and templates. And most of them (at least that I looked in) starts with <@standalone> directive. I searched it in docs, but have no result.

  • What does this specific directive means?

  • Is there any list of all alfresco's freemarker directives in their documentation or somewhere else?


Solution

  • The <@standalone> directive is provided by the org.springframework.extensions.directives.StandaloneWebScriptWrapper class. The full JavaDoc reads:

    /** * <p>This FreeMarker Directive can be used as the outer-wrapper in a WebScript FreeMarker template to add the the * {@link OutputCSSContentModelElement} and {@link OutputJavaScriptContentModelElement} instances into the {@link ExtensibilityModel} * when the WebScript is not processed within the context of a {@link Page}. This ensures that any dependency files are * loaded into the page.</p> * <p>TODO: Currently this only outputs the JS and CSS deferred content model elements. This could be further enhanced to add * additional content elements that set up the structure of a page</p> * * @author David Draper */

    There is no complete list of all the FreeMarker directives - either part of FreeMarker, Surf or Alfresco - that I am aware of.