Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello!
Just started to develop a new website with the latest build (Umbraco version 7.4.1 assembly: 1.0.5891.23238), and found that
umbraco.library:GetMedia()/umbracoFile
returns a new schema, and i can not get rid of it.
<img src="{umbraco.library:GetMedia(./image, 0)/umbracoFile} />
returns this:
<img src="{src: '/media/1001/1-nothumbnail.jpg', crops: []}>
I just want the URL of the image, nothing else.. Anyone experienced the same?
Thanks, Istvan
Hi Istvan,
Yes, that's the new Umbraco 7 way - many property editors are storing their data as JSON these days...
If you just want the URL and doesn't want to handle the croppings, you can use another helper method to turn the JSON chunk into XML:
<xsl:variable name="mediaNode" select="umbraco.library:GetMedia(image, false())" /> <xsl:variable name="data" select="umbraco.library:JsonToXml($mediaNode/umbracoFile)" /> <img src="{$data/src}" />
Hope that helps,
/Chriztian
Hi Chriztian!
Thanks, your solution works, as always! :)
Wondering how i could not realize that the return format is JSON..
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
XSLT GetMedia/umbracoFile returns new schema??
Hello!
Just started to develop a new website with the latest build (Umbraco version 7.4.1 assembly: 1.0.5891.23238), and found that
returns a new schema, and i can not get rid of it.
returns this:
I just want the URL of the image, nothing else.. Anyone experienced the same?
Thanks, Istvan
Hi Istvan,
Yes, that's the new Umbraco 7 way - many property editors are storing their data as JSON these days...
If you just want the URL and doesn't want to handle the croppings, you can use another helper method to turn the JSON chunk into XML:
Hope that helps,
/Chriztian
Hi Chriztian!
Thanks, your solution works, as always! :)
Wondering how i could not realize that the return format is JSON..
Thanks, Istvan
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.