XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Major Major
    • 4.3
    • None
    • freemarker
    • 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

            gjoseph Magnolia International
            gjoseph Magnolia International
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: