[MGNLRES-300] Generic Resource Linking Created: 20/Apr/17 Updated: 14/Dec/23 Resolved: 14/Dec/23 |
|
| Status: | Closed |
| Project: | Magnolia Resources Module |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 4.0.0, 3.0.10 |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Matthias Müller | Assignee: | Quach Hao Thien |
| Resolution: | Fixed | Votes: | 3 |
| Labels: | VN-Analysis, nucleus | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | 2d 3.5h | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[X]*
Doc/release notes changes? Comment present?
[X]*
Downstream builds green?
[X]*
Solution information and context easily available?
[X]*
Tests
[X]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Release notes required: |
Yes
|
| Documentation update required: |
Yes
|
| Date of First Response: | |
| Epic Link: | Maintenance of Resources module |
| Story Points: | 5 |
| Team: | |
| Work Started: | |
| Approved: |
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:
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] |
| Comments |
| Comment by Kathrin Kaufleitner [ 31/Jan/20 ] |
|
another great improvement would be to add the 'otherAttributes' Parameter to the resfn-js as resfn-css already has: String js(String pattern, String otherAttributes) |
| Comment by Quach Hao Thien [ 03/Mar/22 ] |
Discovery completedProvide APIs to allow user adds optional attributes to <script> tag
|