Uploaded image for project: 'PUBLIC - Liferay Documentation'
  1. PUBLIC - Liferay Documentation
  2. LRDOCS-6247

Add explanations to enable the global valuable

    Details

    • Type of Documentation:
      User

      Description

      While I was working on creating a custom ADT and templates to display Web contents, I was struggled to enable global valuable access was changed from 6.2.
      The article I could find this time on dev.liferay.com was ,

      https://dev.liferay.com/ja/discover/portal/-/knowledge_base/7-1/using-taglibs-in-templates
      

      "Note: The utilLocator, objectUtil, and staticUtil variables for FreeMarker and the utilLocator variable...." part.

      As far as I looked up the dev.liferay.com, I couldn't find appropriate documents explaining about this. Since people working on templates are less technical in my experiences as a consultant, these explanation below will be helpful:

      • how to enable global values in templates and ADT
      • how to export/import the configurations to enable global values
      • where the user should refer the value to be able to designate in the properties.

      To enable global values, in 6.2, it was

       velocity.engine.restricted.classes=
       velocity.engine.restricted.variables=
       freemarker.engine.restricted.classes=
       freemarker.engine.restricted.variables=
      

      But now
      Navigate to Control Panel -> Configuration -> System Settings -> Template Engines -> FreeMarker Engine
      and edit variables there. (I only used Freemarker, so Velocity, Soy Template and XSL Engine should be considered as well)

      Also, I knew that data can be exported as
      com.liferay.portal.template.freemarker.configuration.FreeMarkerEngineConfiguration.cfg and can be placed under $LIFERAY_HOME/osgi/configs to enable the configuration.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:

                Packages

                Version Package
                7.0.x
                7.1.x
                7.2.x