Copied to clipboard

Flag this post as spam?

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


  • pna 11 posts 31 karma points
    Nov 09, 2010 @ 22:29
    pna
    0

    Getmedia U v. 4.5.2

    I am trying to create a  list of all fields on subpages and it works fine for text-fields (Tiny mce). But when I try to extract the content of an upload field  with an image - i get nothing. I have seen some of the postings concerning Getmedia and 4.5.2 - but I can't get it woorking.

    My code i quite simple.......

    when I run

     <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a>
      <xsl:value-of select="kunde_TXT" disable-output-escaping="yes"/>
      <br />
      <xsl:value-of select="picture" disable-output-escaping="yes"/>
      <br />

    I get the

       - the name of the subpage

       - the text in "Kunde_TXT " 

       -  the  filename (including the path)    of "pictue"

     

    But when i run

     

     <xsl:if test="$currentPage/picture !=''">
        <xsl:variable name="media" select="umbraco.library:GetMedia($currentPage/picture , '0')" />
        <xsl:variable name="alt" select="umbraco.library:GetMedia($currentPage/picture , 0)/@nodeName" />
            <img src="{$media/umbracoFile}" alt="{$alt}"/>
      </xsl:if>

    i get nothing.

     

    Any ideas- Thx / Poul

     



     


  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 09, 2010 @ 22:55
    Jan Skovgaard
    0

    Hi Paul

    When you're using the Upload field on the node you don't need to use the GetMedia extension - When you use <xsl:value-of select="$currentPage/picture" /> you should get the path to the image.

    I hope this helps.

    /Jan

  • pna 11 posts 31 karma points
    Nov 10, 2010 @ 21:47
    pna
    0

    Thanks Jan . - i actually get the path to the image from

    <xsl:value-of select="picture" disable-output-escaping="yes"/>  but I canĀ“t figure out how to pass that string to an image source. I must admit that xslt in totally new stuff .....

    / Poul

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 10, 2010 @ 22:10
    Jan Skovgaard
    0

    Try writing this in your XSLT then...

    <img src="{$currentPage/picture}" alt="" />

    Then you should be able to get the image displayed. Maybe the $currentPage parameter is not neccessary dependent on the context in, which you will be using this.

    You could also do it like this:

    <img alt="">

    <xsl:attribute name="src"><xsl:value-of select="$currentPage/picture" /></xsl:attribute>

    </img>

    You could also create an attribute-set, but I think google got plenty of samples on how to create them :-)

    /Jan

  • pna 11 posts 31 karma points
    Nov 10, 2010 @ 22:49
    pna
    0

    Hi Jan - thank you for your patience ............. I got

    <img alt="">
    <xsl:attribute name="src"><xsl:value-of select="picture" /></xsl:attribute>
    </img

    to work......

    /Poul


     


Please Sign in or register to post replies

Write your reply to:

Draft