adobe / asset-share-commons

A modern, open-source asset share reference implementation built on Adobe Experience Manager (AEM)
https://opensource.adobe.com/asset-share-commons/
Apache License 2.0
89 stars 106 forks source link

Get static thumbnail on asset share commons details page. #904

Open amanmishra17 opened 1 year ago

amanmishra17 commented 1 year ago

Hi Team, We have a use case where we need to show the static thumbnail on Asset Share Commons details page of an asset. These static thumbnails are added manually in the AEM author for those particular assets, which are of type zip, html, etc.

Any input to achieve this would be appreciated.

Thanks.

davidjgonzalez commented 1 year ago

I think the easiest way would be to create a new preview component that renders the image base don the asset type, and just add that to the details page. This should be rather easy to make, especially if your logic is hardcode-able (and not author-able).

Initially i thought you could use placeholders, but that would mean the asset's primary image rendition [2] should have to resolve to null -- which i guess you could do by making a Asset Rendition name [1] that resolves to something that doesnt exist, so the placeholder image is used [2] - but that's kinda hacky. You would also need to make details pages [3] for each "asset type" that needs a different thumbnail, so you can set the placeholder for that type (and this assumes the OOTB AEM asset type mapping is of sufficient granularity to support this). ... Like i said, this way is rather hacky.

[1] https://opensource.adobe.com/asset-share-commons/pages/development/asset-renditions/ [2] https://opensource.adobe.com/asset-share-commons/pages/details/image/ [3] https://opensource.adobe.com/asset-share-commons/pages/details/details-page/

amanmishra17 commented 1 year ago

Thanks David. I'll check and try these inputs.