-
Sub-task
-
Resolution: Fixed
-
Major
-
None
-
None
Shared variables in Freemarker are a recommended way to have objects available to templates which do not change over the life time of the Freemarker configuration object. In the case of Magnolia, the configuration object is bound to Freemarker - which currently is a "permanent" singleton; it could eventually become an observed one. In any case, adding shared variables is possible.
The advantage of shared variables vs "regular" variables added to the context for each render are:
- these variables are wrapped once and only once over the lifetime of the application
- they are also (obviously) added to a map only once, thus slightly reducing the complexity/time needed to build the context before rendering.
There are probably a few context variable which we could also move to shared variables.
ref: http://freemarker.org/docs/pgui_config_sharedvariables.html
- is causing
-
MAGNOLIA-3190 Freemarker: incomplete configuration of sharedVariables results in StackOverflowError
- Closed
- is depended upon by
-
MAGNOLIA-2993 Extract logic out of taglibs - reusability, testability, ...
- Closed
-
MAGNOLIA-3152 Move "mgnl" (MagnoliaTemplatingUtilities) into FreeMarker shared variables
- Closed
-
MGNLSTK-609 Move "stk" (STKUtil) into FreeMarker shared variables
- Closed
- is related to
-
MAGNOLIA-1469 Make Freemarker more configurable through admininterface
- Closed
-
MGNLSTK-577 Make it configurable what classes are included in the freemarker template rendering context
- Closed
-
MAGNOLIA-5824 Reenable defining freemarker shared variables by configuration
- Closed