Copied to clipboard

Flag this post as spam?

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


  • trfletch 598 posts 604 karma points
    Mar 19, 2009 @ 11:17
    trfletch
    0

    Create link to page with image

    Hi,

    I have setup some XSLT code that shows a list of subpages with a link to them, I also want it to show a thumbnail as a link. The thumbnail is selected using a media picker on the page that the link is point too. So so I have this:

    [code]



    [/code]

    I did try this but it throws up errors when I try and save the XSLT, can anyone see what I am doing wrong?:


    [code]


    [/code]

  • trfletch 598 posts 604 karma points
    Mar 19, 2009 @ 16:24
    trfletch
    0

    Any suggestions on this? I currently have:

    [code][/code]

    Which gives me the node id as the image source, I need it to be the URL of the image instead so I thought that I could just change it to:

    [code][/code]

    But this throws up errors when I try and save the XSLT!!!

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Mar 19, 2009 @ 17:04
    Ismail Mayat
    0

    Tony,

    Your xslt looks fine in the xlst editor check disable checking then save it. It should work. Basically at compile time its trying to getmedia but it has no value however when you view page you will have media and it will work.

    Regards

    Ismail

  • trfletch 598 posts 604 karma points
    Mar 19, 2009 @ 17:10
    trfletch
    0

    Excellent that works correctly, thanks for the quick reponse, I assume if I was to make thumbnail a variable then it would get around that issue.

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Mar 19, 2009 @ 17:13
    Ismail Mayat
    0

    Tony,

    I usually use variable becuase for example in your case you are making 3 getmedia calls that 3 db trips then in a loop so can add up. Also You can wrap the lot with statement !='' then when in editor it should save

    Regards

    Ismail

  • trfletch 598 posts 604 karma points
    Mar 20, 2009 @ 10:57
    trfletch
    0

    I see, thank you for your help. I will look at changing it to a variable.

Please Sign in or register to post replies

Write your reply to:

Draft