Hi I'm following the GetMedia reference to display an image in xslt but I'm getting an 'Error parsing XSLT file: \xslt\Products.xslt'on my page. I can't see where I'm going wrong
<!-- Input the documenttype you want here --> <xsl:variable name="documentTypeAlias" select="string('Product')"/> <xsl:template match="/">
<!-- The fun starts here --> <ul class="all-products">
I forgot to mention productThumbnail is the alias for the media picker, and the images are if a folder within the media picker if that makes any difference.
The code that you had before tried to use the GetMedia-extension even if there where no image selected. This causes an error if no image is selected in one of the mediapickers. Other than that, you where using some parts of the old XML scheme in your $url, $width and $height.
Displaying image in xslt not working
Hi I'm following the GetMedia reference to display an image in xslt but I'm getting an 'Error parsing XSLT file: \xslt\Products.xslt'on my page. I can't see where I'm going wrong
I'm using the 4.5.1. Any ideas?
I forgot to mention productThumbnail is the alias for the media picker, and the images are if a folder within the media picker if that makes any difference.
Try this one out:
The code that you had before tried to use the GetMedia-extension even if there where no image selected. This causes an error if no image is selected in one of the mediapickers. Other than that, you where using some parts of the old XML scheme in your $url, $width and $height.
Does the above code work?
/Kim A
Hi Ivor,
you definitely don't need the @alias part anymore in 4.5+ and you would need to get the image by appending /Image, please see here at the bottom.
Hope that helps,
Sascha
Actually you might want to put the first:
inside of the <xsl:if> as well, to make sure there's not rendered an empty a-tag if no image is selected in the media picker.
/Kim A
@Sascha:
In v.4.5.1 there is no more need of the /Image as far as I'm concerned :)
/Kim A
Oh, that's much better, didn't know that. :)
@Kim Thanks for the snippet I'm not getting the same error,However its not showing the image or the link now though
my codes looks like this now:
Hmm...well does the current page have a mediaPicker called productThumbnail or is it the child-nodes that the images shall be shown from?
In that case you need to change it to:
/Kim A
Cool that worked, the child-nodes have the mediaPicker on it.
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.