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
    Jan 05, 2011 @ 01:06
    trfletch
    0

    Displaying image for gallery

    Hi,

    I am trying to use this for an image gallery (I haven't found anything better that you can use to add an endless amount of images). I am using Umbraco 4.6 but with the old XSLT schema but the default XSLT that comes with it just displays a list of the image names and the URL points to #

    Can anyone help me modify the XSLT so that it displays an image, I assume I am going to need some sort of umbraco.library:GetMedia command but can't work out exactly what it is,

    Regards

    Tony

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 05, 2011 @ 08:08
    Dirk De Grave
    0

    Sure, people can help, but may be nice to give us a starting point... Get your code here and we'll be glad to help.

    Anyway, if you want to retieve a single image from the media section, use

    umbraco.library:GetMedia($nodeId, false() | true())

    where $nodeId is the id of the media item. Second param is useful if you want to retrieve all images from a folder in a single call (use true())

    GetMedia returns a xml fragment which you can query using xpath.

    If using the old schema, you should be able to get the image file path using

    umbraco.library:GetMedia($nodeId, false())/data [@alias = 'umbracoFile']

    If using the nex schema, use

    umbraco.library:GetMedia($nodeId, false())/Image/umbracoFile

    All examples should be used from within xslt!

    Hope this helps.

    Regards,

    /Dirk

Please Sign in or register to post replies

Write your reply to:

Draft