In version 4 I used to have this piece of code in order to get a media folder which has been attached to the page through a document type media picker option. ImgFolder is the name of the document type alias.
<xsl:variable name="docFolder" select="number($currentPage/folderWithImages)"/> <xsl:for-eachselect="umbraco.library:GetMedia($docFolder, 'true')/*"> <!-- place content here --> <xsl:value-of select="*[name() = 'umbracoFile']"/><!--get the source of teh image--> </xsl:for-each>
Really simple however there is weird thing which I need to share with you. When trying to save there is an error. Probably it doesn't recognize the variable $docFolder as an Int. If I press ignore erros and save it does work properly.
Error occuredSystem.OverflowException: Value was either too large or too small for an Int32.
at System.Convert.ToInt32(Double value)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType)
at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
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)
Get media folder
Hello,
In version 4 I used to have this piece of code in order to get a media folder which has been attached to the page through a document type media picker option. ImgFolder is the name of the document type alias.
Then I used that piece of code in my xslt to retreive all images listed under the selected folder
I am trying the same on version 4.5.2 with no luck. As far as I know there are changes on the xml.
Any ideas how to get same result in new version of xml?
Cheers,
Giorgos
Ok maybe I was in a hurry to ask for your help,
It wanst that different.
Really simple however there is weird thing which I need to share with you. When trying to save there is an error. Probably it doesn't recognize the variable $docFolder as an Int. If I press ignore erros and save it does work properly.
Any ideas why is this happening
Cheers,
Giorgos
Ok,
I got the answer from another post
http://our.umbraco.org/forum/developers/xslt/11631-Pulling-photos-from-a-media-folder
Thanks
is working on a reply...