Details

      Description

      The DLUtil class is currently not accessible from Velocity and Freemarker templates. In order to reuse the logic contained in this class, in should be injected in the template context.

      As a result, methods of DLUtil can be invoked in Velocity and Freemarker templates. This improvement can be verified by following these steps:

      1. Go to Control Panel > Application Display Templates
      2. Add a new template "Mime Type List" for Document and Media.
      3. Select "Freemarker" as language and paste this code in the editor:

      <#assign mimeTypes = dlUtil.getAllMediaGalleryMimeTypes() />
      
      <ul>
          <#list mimeTypes as mimeType>
              <li>${mimeType}</li> 
          </#list>
      </ul>
      

      Notice that a method of dlUtil is being invoked to retrieve a list with all mime types supported in media gallery.

      4. Go to a page
      5. Add a Media Gallery portlet into the page
      6. Edit the portlet configuration and select "Mime Type List" from the Display Template list.
      7. Save changes.

      The portlet displays the list of mime types retrieved through the dlUtil class.

        Attachments

          Activity

            People

            • Assignee:
              evan.nagayama Evan Nagayama (Inactive)
              Reporter:
              eduardo.garcia Eduardo García
              Recent user:
              Randy Zhu (Inactive)
              Participants of an Issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 24 weeks, 1 day ago

                Packages

                Version Package
                6.2.0 CE M5