Copied to clipboard

Flag this post as spam?

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


  • Jonas Høiby 62 posts 53 karma points
    Aug 03, 2009 @ 11:34
    Jonas Høiby
    0

    mediaPicker: listing subnodes to a subnode..?

    Hi ...

     

    I have this structure in my media folder:

    Catalogues

    - Asia

      ¤ Catalogue 1

      ¤ Catalogue 2

    - Africa

    - Europe

     

    on my page i just select "Catalogues", and in my macro i set it to post the subnodes to my selection, itll then post Asia, Africa and Europe ..

     

    But how do i go about posting the subnodes the the results i got from the macro? the subnodes to Asia, Africa and Europe? Dynamicly in the same macro?

     

    any help is appreciated - and thanks .. :-)

  • Tommy Poulsen 514 posts 708 karma points
    Aug 03, 2009 @ 11:46
    Tommy Poulsen
    0

    Hi Jonas, do you want all nodes at all levels printed, or only the immediate child-nodes ?

     

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Aug 03, 2009 @ 11:48
    Thomas Höhler
    0

    Just take a look into this thread

    I think this will explain how you can iterate through all subnodes...

    Thomas

  • Tommy Poulsen 514 posts 708 karma points
    Aug 03, 2009 @ 11:51
    Tommy Poulsen
    0

    ... and on this page you can see another example of how to display media using links to subnodes.

    >Tommy

     

  • Jonas Høiby 62 posts 53 karma points
    Aug 03, 2009 @ 14:17
    Jonas Høiby
    0

    just the immideate child nodes ..

     

    something like this maby:

     

    <xsl:for-each select="$currentPage">


    <xsl:if test="./data[@alias = $MediaFolderPicked] != '' ">
    <xsl:for-each select="umbraco.library:GetMedia(./data[@alias = $MediaFolderPicked], 'true')/node">

    @nodeName

    // need next loop here.. something like this maby?
    <xsl:for-each select="umbraco.library:GetMedia('{@id}', 'false')/node">
    @nodeName
    </xsl:for-each>
    //but what about the xslt:if that is needed around it? how do i go bout this?


    </xsl:for-each>
    </xsl:if>


    </xsl:for-each>

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Aug 03, 2009 @ 14:24
    Thomas Höhler
    1

    If you get the medias via GetMedia and the recursive parameter set to true you get the complete tree as a structure like it is on the content node section. So if you are in the first loop you only need to select the next nodelevel: xsl:for-each select="node"

    eg:

    <xsl:if test="$cuurentPage/data[@alias = $MediaFolderPicked] != '' ">
    <xsl:for-each select="umbraco.library:GetMedia($currentPage/data[@alias = $MediaFolderPicked], 'true')/node">
    <xsl:for-each select="node">
    @nodeName
    </xsl:for-each>
    </xsl:for-each>
    </xsl:if>

    hth, Thomas

  • Jonas Høiby 62 posts 53 karma points
    Aug 03, 2009 @ 14:33
    Jonas Høiby
    0

    ohhh.. very nice ... thanks .. =)

  • 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.

Please Sign in or register to post replies