Hm, if I create a new xslt and save this piece, I dont get an error. You do get an error when you save the xslt or when you view the page where the macro is on?
I get an error when using the visualizer (System.OverflowException: Value was either too large or too small for an Int32) and when I view the page it gives an error... 'Error parsing XSLT file: \xslt\AccordianListItems.xslt'
I have just created a new xslt file and added the code but I'm getting the same errors.
GetMedia Error - Value was either too large or too small for an Int32
Hi,
I know this crops up in the forum quite a lot and I have read through various posts to try and resolve it but I'm just having no luck!
Here is my code...
but I just keep getting an error.
Can anyone tell me where I'm going wrong?
Thanks,
Rachel
Rachel,
try this:
<imgsrc="{umbraco.library:GetMedia(./data[@alias='itemContentImage'], 0)/umbracoFile}"/>
</xsl:if>
Peter
Hi Peter,
I'm still getting the same error :(
Rachel
What is displayed when you do a xsl:value-of select="./data[@alias='itemContentImage']" ?
When using the visualizer It says 'The XSLT didn't generate any output'
can you post your entire xslt?
Here you go...
Thank you for looking :)
Hm, if I create a new xslt and save this piece, I dont get an error. You do get an error when you save the xslt or when you view the page where the macro is on?
I get an error when using the visualizer (System.OverflowException: Value was either too large or too small for an Int32) and when I view the page it gives an error... 'Error parsing XSLT file: \xslt\AccordianListItems.xslt'
I have just created a new xslt file and added the code but I'm getting the same errors.
If I replace
with
I no longer get an error but there is also no output for itemContentImage (but I do get output for itemContent)
Ah, I probably can save just fine because I didn't have a property called itemContentImage.
What type of property is that, is it a media-picker or an upload-field?
It's an upload field - does that make a difference? Should I be using a media picker?
Thanks
Yes, that makes a difference, for an upload-field you don't have to use the GetMedia.
I'm not sure about the right syntax here, but if you try this:
<textarea><xsl:copy-of select="./data[@alias='itemContentImage']"/></textarea>
you then should get an idea what is in it and how you can output it.
Peter
Ah, I see!
The textarea is outputting...
??
One other thing that I haven't seen before... itemContent (which is RichText Editor) is also outputting the html tags - how can I prevent that?
Thanks.
Thank you for all your help Peter.
I'm now using the following XSLT and it's displaying the images fine.
Regards,
Rachel
Good you have it working :)
To get rid of the html-tags, use this:
<xsl:value-of select="itemContent" disable-output-escaping="yes"/>
Peter
Thank you :)
is working on a reply...