Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-100963

As a fragment developer I can read the configuration in the JavaScript code

    Details

      Description

      Context

      Fragment developers can choose to make their fragments configurable. Currently the configuration can be read using freemarker to produce HTML. However it is sometimes desirable to be able to read the configuration from JavaScript. Furthermore, making the configuration available in JavaScript enables developers who do not know freemarker to develop configurable fragments.

      Acceptance Criteria

      • Given a fragment with a configuration definition when the JavaScript code is executed then there is a JavaScript configuration object available which contains the current values of the fragment configuration
      • Given a fragment without a configuration definition when the JavaScript code is executed then the JavaScript configuration object is available and is empty.
      • The name and structure of the JavaScript configuration object must be identical to the one currently available in the freemarker context

      Technical notes

      A suggested way to make the JavaScript configuration object available is by passing it as a second parameter in the JavaScript function. For example:

      function(fragmentElement, configuration) {
        // Fragment js code
      }

      The configuration object would be built in a similar way as follows:

      var configuration = {
        field1 = value1,
        field2 = value2
      }

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              manoel.cyreno Manoel Cyreno
              Reporter:
              jorge.ferrer Jorge Ferrer
              Engineering Assignee:
              SE Support
              Recent user:
              Kiyoshi Lee
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package
                  7.2.10 DXP FP2
                  7.2.10.1 DXP SP1
                  7.2.X
                  Master