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

Generic Resource Linking

XMLWordPrintable

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

      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]
      

        Acceptance criteria

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

                Created:
                Updated:
                Resolved:
                Work Started:

                  Task DoD

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