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
88 stars 107 forks source link

Asset having .doc and .ppt are not rendering in details page with presentation.html and document.html #1204

Open skumuda opened 1 day ago

skumuda commented 1 day ago

When .doc and .ppt asset is opened in assetdetails page it not rendered properly.

Environment

To Reproduce Steps to reproduce the behavior:

  1. Go to '/content/asset-share-commons/en/light.html'
  2. Click on any asset which has .doc or .ppt extension
  3. It takes to asset-details page

Expected behavior For .doc URL should be navigating to
http://localhost:5502/content/asset-share-commons/en/light/details/document.html/content/dam/asset-share-commons/en/public/documents/document-sample.doc

For .ppt URL should be navigating to http://localhost:5502/content/asset-share-commons/en/light/details/presentation.html/content/dam/asset-share-commons/en/public/documents/powerpoint-sample.ppt

Actual : URL navigates to http://localhost:5502/content/asset-share-commons/en/light/details.html/content/dam/asset-share-commons/en/public/documents/document-sample.doc

URL navigates to http://localhost:5502/content/asset-share-commons/en/light/details.html/content/dam/asset-share-commons/en/public/documents/powerpoint-sample.ppt

Screenshots Screenshot 2024-11-22 184613 image

davidjgonzalez commented 1 day ago

I recommend using the "newer" (i guess old now :)) Content Type asset selector. This will let you make specific details pages for Word Docs and Powerpoint (word-doc.html and powerpoint.html). You can see the complete mapping list int he ContentTypeImpl.java linked below + screenshot.

The default AssetType asset details selector relies on the AEM API's mimetype to type mapping which a) has changed in the past which is not good for ASC and b) doesnt always make sense for how assets need to be displayed on a details page.

Once you have the desired mapping of type -> asset details page, you can add/configure a preview component (You can try using the Assets Details - Image) and configure it on the page to display the image asset rendition that you want to show on the details page (You have to make sure you are generating image renditions of course).

2024-11-22 at 4 20 PM