4

I am trying to use Media Manager's dynamic image rendition feature. I'm doing this by adding a querystring to image URLs in my view files, as documented here.

The image URLs are delivered from the model to the view in their "unresolved" state, ie. from the domain https://xyz.dist.sdlmedia.com. However, it seems that the querystring method does not work on URLs from this domain - it only works if the URL is "resolved", ie. from the domain https://xyz.ssl.cdn.sdlmedia.com.

Am I missing something?

I found this answer which allows me to manually resolve a URL in the model before it gets to the view, but I don't want to have to add custom properties to every model on an image-by-image basis.

Context: I'm not a .net dev, so apologies if this is basic stuff :)

4

Yes, that is correct. This is because https://xyz.dist.sdlmedia.com is URL of Distribution. One distribution is collection of one or more images (or any other media) grouped in programs and assets. The thing here is that every time you request distribution from Media Manager using https://xyz.dist.sdlmedia.com, Media Manager resolves it to proper image. After you get resolved URL, you can request it again with parameters to resize image.

But you can do another thing. You can take over the role of choosing correct image from distribution. How? Well, you can request following URL to get JSON data of distribution: https://xyz.dist.sdlmedia.com/json/distributionID. It will retrieve JSON with all links in distribution. Then you can pick image URL you want, append parameters to it and request it as such.

  • Thank you, your answer was very helpful - the distinction between distribution and asset is something I often forget. I'll investigate the JSON option as that sounds promising. – wiiiiilllllll Mar 18 at 16:37
  • Great. Json is really good thing because you have all the data there. You can serialize it and then use only the data you need – Marko Milic Mar 18 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.