Good point, it compiled now.. Thanks alot I didn't expect the compiler to look for data. I mean the Xslt File, doesn't which file it is been rendered in?!
Now I'm left wondering why there is no data in the field, when the media picker is filled, the image is OK, and all is published?
Simple GetMedia problem
This works:
<xsl:variable name="media" select="umbraco.library:GetMedia(1070, 0)/data"/>
This doesn't:
<xsl:variable name="media" select="umbraco.library:GetMedia($currentPage/data [@alias = 'PageImage'], 0)/data [@alias = 'umbracoFile']" />
When saving Xslt file, I get this:
(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current)
at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)
at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)
at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)
---
My mediapicker field has @alias='PageImage', and I have done this quite many times before.
Can anybody kick my brain, just a bit.
thanks:)
HI Morten
Try putting a <xsl:if> around your code like this:
This makes sure that the PageImage-field is not empty.
Otherwise you could also check the "Skip testing"-box at the top of the editor, and see if the code fails, or still works.
/Kim A
Good point, it compiled now.. Thanks alot
I didn't expect the compiler to look for data. I mean the Xslt File, doesn't which file it is been rendered in?!
Now I'm left wondering why there is no data in the field, when the media picker is filled, the image is OK, and all is published?
guess I'm rusty.
OK sorry, forget the last comment, I works now. I just don't know why :)
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.