Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom 713 posts 954 karma points
    Mar 02, 2011 @ 07:04
    Tom
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 02, 2011 @ 07:18
    Jan Skovgaard
    1

    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

  • Tom 713 posts 954 karma points
    Mar 02, 2011 @ 07:19
    Tom
    0

    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!

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 02, 2011 @ 07:22
    Jan Skovgaard
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft