Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi guys couldn't seem to find any documentation on how the new xml format effects files..
I'm trying to say for a given folder id, find me the folder below who's name is the current year
<xsl:variable name="currentYearContentFolder" select="umbraco.library:GetMedia($brokerFileFolder,true())/descendant-or-self::Folder [@nodeName = string($currentYear)]"/> <xsl:variable name="previousYearContentFolder" select="umbraco.library:GetMedia($brokerFileFolder,true())/descendant-or-self::Folder [@nodeName = string($currentYear - 1)]"/>
and from there i'll iterate over each file
<xsl:for-each select="umbraco.library:GetMedia($currentYearContentFolder/@id,'1')/File">
I can't for the life of me work out why the folder variable isn't being assigned..
Cheers,
Tom
Hi Tom
What do you get outputted if you make a copy-of on the folder variables?
If you do like this
<textarea><xsl:copy-of select="$currentYearContentFolder" /></textarea>
What does this return?
And how does the $brokerFileFolder contain? And how is it's value assigned?
/Jan
Hi Jan thanks for the reply..
My bad.. i needed to re-save the media folder for some reason??
strange.. but either way it worked!
Have you made an upgrade of a previous vesion before 4.5? Then I guess it makes sense that the XML chache needs to be refreshed since the content was otherwise wrapped in the old XML syntax...could that be the cause?
Happy you got it sorted btw :-)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Trouble Traversing Files/Folders in new xml format
Hi guys couldn't seem to find any documentation on how the new xml format effects files..
I'm trying to say for a given folder id, find me the folder below who's name is the current year
<xsl:variable name="currentYearContentFolder" select="umbraco.library:GetMedia($brokerFileFolder,true())/descendant-or-self::Folder [@nodeName = string($currentYear)]"/>
<xsl:variable name="previousYearContentFolder" select="umbraco.library:GetMedia($brokerFileFolder,true())/descendant-or-self::Folder [@nodeName = string($currentYear - 1)]"/>
and from there i'll iterate over each file
<xsl:for-each select="umbraco.library:GetMedia($currentYearContentFolder/@id,'1')/File">
I can't for the life of me work out why the folder variable isn't being assigned..
Cheers,
Tom
Hi Tom
What do you get outputted if you make a copy-of on the folder variables?
If you do like this
<textarea>
<xsl:copy-of select="$currentYearContentFolder" />
</textarea>
What does this return?
And how does the $brokerFileFolder contain? And how is it's value assigned?
/Jan
Hi Jan thanks for the reply..
My bad.. i needed to re-save the media folder for some reason??
strange.. but either way it worked!
Hi Tom
Have you made an upgrade of a previous vesion before 4.5? Then I guess it makes sense that the XML chache needs to be refreshed since the content was otherwise wrapped in the old XML syntax...could that be the cause?
Happy you got it sorted btw :-)
/Jan
is working on a reply...