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 have a macro which takes two parameters - both mediaCurrent data types. Both of these are used to load images into the macro.
The values are being passed through okay, but instead of media id the mediaCurrent data type seems to send a full string of the media item e.g. 'media/987/mypic.png801075259png'. I just need the first part (the file path).
Question is, how to I get just the file path out of this? I expected the output of a mediaCurrent data type to be in XML, but if I output the value into a <textarea></textarea> it still just shows as a string it seems, so I'm a little confused how to deal with it, other than some really hacky XSLT regular expression or string manipulation.
The mediaCurrent type returns the entire XML for the Media Item, you'll see this if you do a <xsl:copy-of... into a textarea.
To get just the file path:
<xsl:variable name="yourVariable" select="/macro/yourParam"/><xsl:value-of select="$yourVariable/*/umbracoFile"/>
Suggestion: do an xsl:copy-of of the mediaCurrent, that will show you all the xml structure underneath, so you can define the Xpath you'll need. I think it will turn out to be a "/umbracoFile" xpath.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted