I want to pull an image out of the media folder by using the ParentID of the current page... So it is an image for a given section. I am at wits end. I have created an XSLT and a macro... but all I ever get is parse errors. I am really trying to do this in XSLT vs C# or hard coding.
I am seriously lacking something here...can someone point the way?
If I understand you correctly you wan´t to display an image from an upper level. I havde made something similar: A have a media picker property on my pages (pageimage):
Image URL: Pulling from the Media Folder
I want to pull an image out of the media folder by using the ParentID of the current page... So it is an image for a given section. I am at wits end. I have created an XSLT and a macro... but all I ever get is parse errors. I am really trying to do this in XSLT vs C# or hard coding.
I am seriously lacking something here...can someone point the way?
You need the folderid or the imageid to get anything from the media section.
Show us your XSLT and we might be able to help you
Hi Eric,
If I understand you correctly you wan´t to display an image from an upper level. I havde made something similar: A have a media picker property on my pages (pageimage):
<xsl:variable name="item" select="$currentPage/ancestor-or-self::* [@isDoc][string(pageimage)!=''] [position()=1] /pageimage" />
<xsl:if test="$item != ''">
<xsl:variable name="image" select="umbraco.library:GetMedia($item, 1)" />
<img src="{$image/umbracoFile}" />
</xsl:if>
I an image is picked on an upper level it wil be rendered on the current page.
Hope it makes sense.
Regards,
Martin
is working on a reply...