Copied to clipboard

Flag this post as spam?

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


  • Loekos 3 posts 20 karma points
    Mar 19, 2009 @ 10:51
    Loekos
    0

    Listing products thumbnails

    Hi guys,

    I'm new to umbraco and XSL. I watched the video's on umbraco.tv but i still have questions about XSLT. I hope someone here can help me how to do the following:

    I've got an website structure which looks for example like this:

    - Home
    -- About us
    -- Products
    -+- Product Category 1
    -+-+ Product item 1
    -+-+ Product item 2
    -+-+ Product item 3
    -+- Product Category 2
    -+-+ Product item 1

    I want that when i visit the Product Category 1 page i see al the Product Items who are in Product Category 1 as an thumbnail.

    Can somebody tell me how i do this with xslt?

    Question 2,
    In the document type 'Product Item' I created a tab with 2 properties, image and thumbnails which both are a media picker. Is this the right way to do?

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Mar 19, 2009 @ 11:12
    Dirk De Grave
    0

    Hi Loekos,

    Welcome to umbraco.
    I'm seeing you're on the right track... just need some xslt and you're set ;)

    If you're on a 'Product Category' page, all you need is a simple xslt file that will iterate the child nodes from the current page.

    I'm sure there's a template already available for this ('List Pages From Current Page') which you'll need to adapt to include support for listing images and thumbnails.

    Code snippet for getting the filename of the image...

    [code]
    [/code]

    (Need to replace 'AliasOfMediaPicker' with the alias of the media picker...)

    Hope this helps.

    Regards,
    /Dirk

  • Loekos 3 posts 20 karma points
    Mar 19, 2009 @ 12:05
    Loekos
    0

    Hi Dirk,

    Thanks alot for you're help. I created the following XSLT file but it gives an error.
    I don't see what i'm doing wrong.






    Another question is am I doing it right that when I want to make a product document type that I created a tab with 2 properties, image and thumbnails which and that they are both a media picker.

  • dandrayne 1138 posts 2262 karma points
    Mar 19, 2009 @ 13:06
    dandrayne
    0

    Looks about right, but try using current() to access the node currently being accessed within the loop?

    e.g.




  • Loekos 3 posts 20 karma points
    Mar 19, 2009 @ 14:02
    Loekos
    0

    Hi guys,

    thanks for this, it was the current() statement.
    The only thing what isn't working i want to get the thumbnail
    my code is now like this:

    [code]

  • dandrayne 1138 posts 2262 karma points
    Mar 20, 2009 @ 10:41
    dandrayne
    0

    I'm not sure about the

    , '.', 'thumb.jpg')

    So I may not be able to help, but


    current()/data [@alias = 'productAfbeelding']

    Should get the ID of the image picked via the media picker, and



    Should get the image from the media library when the ID is passed in, so I'm not sure of the need for adding the _thumb as long as imagename
    thumb.jpg is in the library.

    WHat error message are you getting?

    Dan

Please Sign in or register to post replies

Write your reply to:

Draft