Copied to clipboard

Flag this post as spam?

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


  • Claushingebjerg 886 posts 2415 karma points
    Nov 23, 2010 @ 14:53
    Claushingebjerg
    0

    Problem with getmedia 4.5.2

    Can anybody see whats wrong with this

    <xsl:variable name="media" select="umbraco.library:GetMedia(/macro/imageID, 0)" />
    <img src="{$media/umbracoFile}" />

    the macro throws an error...

    If i do a simple

    <xsl:value-of select="/macro/imageID"/>

     

    i get "/media/41/suni.gif152793150gif" so there is data present inside the scope...

     

  • Chriztian Steinmeier 2726 posts 8320 karma points MVP 4x admin c-trib
    Nov 23, 2010 @ 14:58
    Chriztian Steinmeier
    1

    Hi Claus,

    Looks like it's a "mediaCurrent" variable, right?

    Those already return the XML, so you can just do:

    <xsl:variable name="media" select="/macro/imageID" />
    <img src="{$media/umbracoFile}" />

    /Chriztian

  • Claushingebjerg 886 posts 2415 karma points
    Nov 23, 2010 @ 15:15
    Claushingebjerg
    0

    Yes, its a mediaCurrent, but it still doesnt work for some reason...

    when doing a <xsl:copy-of select="$media/umbracoFile"/> i get nothing

    <xsl:copy-of select="$media"/> returns /media/41/suni.gif152793150gif ?!? strange...

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Nov 23, 2010 @ 15:22
    Jan Skovgaard
    0

    Hi Claus

    But isn't it the path that you need? Then you will just need the $media variable, right?

    The output looks like you're using the "upload" datatype on your page...and then I guess it all makes sense (if i'm right off course :-))

    /Jan

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Nov 23, 2010 @ 15:27
    Jeroen Breuer
    1

    I also had this problem. Somehow I had a problem with putting it into a variable, but getting it directly worked:

    You could try something like this:

    /macro/imageID/Image/umbracoFile

    Now you get the value directly from the macro instead of the variable. Worked for me.

    Jeroen

  • Claushingebjerg 886 posts 2415 karma points
    Nov 23, 2010 @ 15:28
    Claushingebjerg
    0

    Thanks Jeron, that worked

  • Chriztian Steinmeier 2726 posts 8320 karma points MVP 4x admin c-trib
    Nov 23, 2010 @ 15:33
    Chriztian Steinmeier
    0

    Ah ok - might be getting more than we asked for, so to speak - what does this give you:

    <xsl:copy-of select="/macro" />

    Hopefully something along the lines of:

    <macro>
        <imageID>
            <Image>
                <umbracoFile>/media/41/suni.gif</umbracoFile>
                <umbracoWidth>...</umbracoWidth>
                <!-- More image properties  -->
            </Image>  
        </imageID>
    </macro>
    
    ?

    /Chriztian 

  • Claushingebjerg 886 posts 2415 karma points
    Nov 23, 2010 @ 15:37
    Claushingebjerg
    0

    i get

     

    <macro>
    <link>1064</link>
    <imageID>
    <Image id="1076" version="d11a7686-c0c7-4124-856a-311d62dc65aa" parentID="1075" level="2" writerID="0" nodeType="1032" template="0" sortOrder="1" createDate="2010-11-23T11:43:19" updateDate="2010-11-23T11:43:18" nodeName="test" urlName="test" writerName="Administrator" nodeTypeAlias="Image" path="-1,1075,1076">
    <umbracoFile>/media/41/suni.gif</umbracoFile>
    <umbracoWidth>152</umbracoWidth>
    <umbracoHeight>79</umbracoHeight>
    <umbracoBytes>3150</umbracoBytes>
    <umbracoExtension>gif</umbracoExtension></Image>
    </imageID>
    </macro>
  • 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