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
I’m using Umbraco 4.7.0
My goal is to get the image path from a hard coded media node id of 4191. If I create a new macro with the code:
<xsl:copy-of select="umbraco.library:GetMedia(4191, false())"/>
I get the output:
/media/17675/my image.jpg50033618497jpg
I was expecting some well formed xml, however, it appears I’m missing all the tags. I therefore cannot reference the path for the image directly.
Am I missing something really simple here?
are you putting the output in a textarea? or viewing the source output of the page?
you can actually get the image path by using
<xsl:vaule-of select="umbraco.library:GetMedia(4191,false())/umbracoFile"/>
You can then use something like this to actually render the image in your html
<xsl:variable name="picFile" select="umbraco.library:GetMedia(4191,false())/umbracoFile"/>
<xsl:if test="$picFile != '' "><img src="{$picFile}"/></xsl:if>
Thank you bob baty-barr. I discovered how to get the raw xml output from my `copy-of` statement. I needed to wrap it in a `<textarea>` tag:
<textarea> <xsl:copy-ofselect="umbraco.library:GetMedia(4191, false())"/> </textarea>
<textarea> <xsl:copy-ofselect="umbraco.library:GetMedia(4191, false())"/>
</textarea>
Thank to this post
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Schoolboy error or is something wrong with my output?
I’m using Umbraco 4.7.0
My goal is to get the image path from a hard coded media node id of 4191. If I create a new macro with the code:
<xsl:copy-of select="umbraco.library:GetMedia(4191, false())"/>
I get the output:
/media/17675/my image.jpg50033618497jpg
I was expecting some well formed xml, however, it appears I’m missing all the tags. I therefore cannot reference the path for the image directly.
Am I missing something really simple here?
are you putting the output in a textarea? or viewing the source output of the page?
you can actually get the image path by using
You can then use something like this to actually render the image in your html
Thank you bob baty-barr.
I discovered how to get the raw xml output from my `copy-of` statement. I needed to wrap it in a `<textarea>` tag:
Thank to this post
is working on a reply...