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

Allow portlets to define js / css that runs only once per request

    Details

    • Branch Version/s:
      6.0.x
    • Backported to Branch:
      Committed

      Description

      Javascript and CSS defined in liferay-portlet.xml like the following will be linked once per portlet instance.

      <footer-portlet-javascript>/gadgets/js/shindig-container?c=1&debug=1&nocache=1</footer-portlet-javascript>
      <footer-portlet-javascript>/gadget/js/main.js</footer-portlet-javascript>

      The following change will allow an option to only load the js and css once per request in case there is any static initialization that needs to take place.

      To load in "singleton" mode

      <footer-portlet-javascript singleton="true">...

      The following elements in liferay-portlet.xml can specify the optional "singleton" attribute:

      header-portal-css
      header-portlet-css
      header-portal-javascript
      header-portlet-javascript
      footer-portal-css
      footer-portlet-css
      footer-portal-javascript
      footer-portlet-javascript

      See liferay-portlet-app_6_1_0.dtd for the full definition.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  6 years, 10 weeks, 3 days ago

                  Packages

                  Version Package
                  --Sprint - SP
                  6.1.0 CE RC1