[MGNLDAM-551] Add function getAssetlink to DamTemplatingFunctions which takes an Asset and does not require a MediaType Created: 05/Mar/15  Updated: 26/May/15  Resolved: 18/May/15

Status: Closed
Project: Magnolia DAM Module
Component/s: DAM Templating
Affects Version/s: 2.1
Fix Version/s: 2.1

Type: Improvement Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Christopher Zimmermann
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

In a template, there is no convenient way to get the link for an asset rendition when you have an asset and the renditionname.

Add new function: getAssetLink(Asset asset, String renditionName)



 Comments   
Comment by Espen Jervidalo [ 10/Mar/15 ]

After latest changes to dam, this won't work anymore. If you don't specify a MediaType, you won't get a renderer back. You should be able to retrieve the mediaType from the asset with asset.mediaType or similar.
Please close as deprecated.

Comment by Christopher Zimmermann [ 18/May/15 ]

Fixed it to work with the DAM changes by retrieving the MediaType from the asset.
On branch MGNLDAM-551-b

https://git.magnolia-cms.com/gitweb/?p=modules/dam.git;a=blob;f=magnolia-dam-templating/src/main/java/info/magnolia/dam/templating/functions/DamTemplatingFunctions.java;h=9f5c63de9c9cbdd7f8eb2bb22f2f72ae131e1219;hb=a2f9a1ecc3cee830a011a59647358845ed20ee98

Generated at Mon Feb 12 05:00:57 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.