Uploaded image for project: 'Magnolia Resources Module'
  1. Magnolia Resources Module
  2. MGNLRES-300

Generic Resource Linking

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Neutral
    • 4.0.0, 3.0.10
    • None
    • None
    • Yes
    • Yes
    • 5
    • Yes

    Description

      The module magnolia-resources-templating provides with "restfn" the possibility to include JavaScript and CSS resources directly. As the provided templating functions "cachedJs" and "cachedCss" render the whole HTML Tag, some use cases are not covered by this very specific solution:

      • "<script>"-tags with additional attributes like "async"
      • other types of resources (e.g. a favicon)

      A generic solution, returning only the resource-link(s) would be nice and future-proof:

      <link rel="apple-touch-icon" href="${resfn.cached('/some-module/resources/touch-icon.png')}">
      
      [#list resfn.cachedList('/some-module/*.js') as link]
      <script src="${link}" async></script>
      [/#list]
      

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              thien.quach Quach Hao Thien
              mmueller Matthias Müller
              Nucleus
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Work Started:

                Checklists

                  Task DoD

                  Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - Not Specified
                    Not Specified
                    Logged:
                    Time Spent - 2d 3.5h
                    2d 3.5h