Details
-
Improvement
-
Resolution: Fixed
-
Neutral
-
None
-
None
-
-
Empty show more show less
-
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