Copied to clipboard

Flag this post as spam?

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


  • Streety 358 posts 567 karma points
    Oct 05, 2010 @ 16:58
    Streety
    0

    Displaying Images in XSLT

    Hello,

    I have a XSLT script that does a for each on the sub pages of my products.

    I can show links and bodytext information no problem but I want to display a logo associated with a product but if i wrap say

    <xsl:value-of select="data [@alias = 'productLogo']"/>

    in a <img src'     ' /> I get a compile error. if I use " I get a complile error too.

    If I just output the value I get the path to the file as expected. What am I doing wrong?

    Thanks

  • Lee Kelleher 3945 posts 15163 karma points MVP 10x admin c-trib
    Oct 05, 2010 @ 17:09
    Lee Kelleher
    1

    Hi Streety,

    Do you know what type of data-type the "productLogo" property is using? A media picker or upload field?

    If it's a Media Picker, then take a look at a blog post that I wrote a while back about GetMedia: http://blog.leekelleher.com/2009/11/30/how-to-use-umbraco-library-getmedia-in-xslt/

    If it's an Upload field, then its probably a syntax error in the XSLT. You could use something like this?

    <img src="{data[@alias='productLogo']}" />

    Cheers, Lee.

  • Streety 358 posts 567 karma points
    Oct 05, 2010 @ 18:23
    Streety
    0

    Thank you.

     

    That sorted it.

  • 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