In this post we will talk about Sitecore Content Hub renditions, media processing settings and flows and also share a code logic you may need to use when working with DAM and assets renditions, specially if you know there is no auto refresh of renditions in Content Hub, so if you added or made any changes to your media processing settings, this will take affect on the new uploaded/processed assets but not existing un-updated assets.
So, What is renditions?
we can define renditions as variations of an assets in content hub, with a unique Url to access this variation, we can also define it as the output of a media processing jobs, which is controlled by the media processing settings that ca be defined by users with the right permission in Content Hub.
The rendition consists of the rendition's name and its rendition items. By default, an asset's renditions are named like this (but can be customized):
- "bigthumbnail"
- "downloadAlternative"
- "downloadOriginal"
- "downloadPreview"
- "metadata"
- "pdf"
- "preview"
- "thumbnail"
What is Media Processing Sets/Flows?
Within Sitecore Content Hub and through the admin area, you can access the media processing page, which offer you the ability to define media processing set, which is a group of flows, in which you control how the assets flow during the processing job and also define the output renditions, so for each processing set you can define multiple flows, and each flow has a name and file types (extensions) that control which assets will go through the flow.
In the media processing page, you will be able to add, delete and update media processing sets, noticing that these medication will not be reflected to the existing assets unless we manually use the mass refresh rendition job through UI, and refresh renditions for the assets needed.
Here is where you can read more about Content Hub Media Processing
https://docs.stylelabs.com/content/3.4.x/user-documentation/administration/processing/media-processing/media-processing-management.html
Also, If you want to read more about refresh renditions, you can check the following:
https://docs.stylelabs.com/content/3.4.x/user-documentation/content-user-manual/edit/edit-content.html#refresh-renditions
How to programmatically read Processing Setting?
You may start to sense that need for the ability to programmatically read a media processing set and loop through its flows and extensions, also each flow defined renditions, here is a code you can use:
How to programmatically get asset rendition?
Here is a simple code that allow you to check if a specific rendition exists for a a specific asset:
Hope the above helped, please feel free to drop comments or questions in the post comments, or email me here.
No comments:
Post a Comment