Copied to clipboard

Flag this post as spam?

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


  • Arnim Anhut 137 posts 148 karma points
    Jul 07, 2009 @ 14:06
    Arnim Anhut
    0

    Using mediaCurrent on image folder?

    Hello,

    I'm trying to access an folder containing images by XSLT. I want' the specific folder to be choosen inside the macro. So I used a mediaCurrent to select a image folder but it returns nothing.

    Is mediaCurrent able to return a folder-node? If not, how do I access a folder node inside the media-tree from outside the XSLT by using a macro?

    Greets, Arnim.

  • Tommy Poulsen 514 posts 708 karma points
    Jul 07, 2009 @ 14:13
    Tommy Poulsen
    5

    Hi Arnin, mediaCurrent will give you the xml node containing the media info.

    See this example:

    <xsl:variable name="MediaNodeId" select="/macro/MediaNode/node/@id"/>
    ...
    <xsl:if test="$MediaRootId != '' ">
    ...
    <!-- Show url -->
    <xsl:value-of select="umbraco.library:GetMedia($MediaNodeId, 'false')/data [@alias = 'umbracoFile']"/>
    ...
    <!-- Show image -->
    <img>
    <xsl:attribute name="src">
    <xsl:value-of select="umbraco.library:GetMedia($MediaNodeId, 'false')/data [@alias = 'umbracoFile']"/>
    </xsl:attribute>
    </img>
    ...
    </xsl:if>

     

    You can check out more here.

     

    >Tommy

     

     

  • Arnim Anhut 137 posts 148 karma points
    Jul 07, 2009 @ 14:32
    Arnim Anhut
    0

    Perfect and EXACTLY (sorry for shouting) what I was looking for!

    Thanx a lot, you solved my problem in less than 10 minutes!

    Greets, Arnim.

  • Tommy Poulsen 514 posts 708 karma points
    Jul 07, 2009 @ 14:34
    Tommy Poulsen
    0

    I'm glad I was able to help out

    >Tommy

     

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 07, 2009 @ 14:43
    Peter Dijksterhuis
    0

    *just reminding the original poster to mark the right post as solution*

  • Arnim Anhut 137 posts 148 karma points
    Jul 07, 2009 @ 14:47
    Arnim Anhut
    1

    I tried to mark your answer as the solution but this doesn't seem to work :-(

    Oh, by the way, in both of your examples on your homepage (I guess its yours) you have an error. First you declare a variable named "MediaNodeId" but later on you refer to "MediaRootId" - guess you should change that.

    Arnim.

  • Arnim Anhut 137 posts 148 karma points
    Jul 07, 2009 @ 14:48
    Arnim Anhut
    0

    @Peter: I did, three times... its says "solved" but when I visit the thread again its back to normal?!?

  • Tommy Poulsen 514 posts 708 karma points
    Jul 07, 2009 @ 14:51
    Tommy Poulsen
    0

    @Arnim: Thanks for pointing out the errors on the site. I will correct them immediately.

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 07, 2009 @ 14:52
    Peter Dijksterhuis
    0

    @Arnim uh oh, perhaphs a good idea to post this in forum-bugs then

Please Sign in or register to post replies

Write your reply to:

Draft