Copied to clipboard

Flag this post as spam?

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


  • Nicolas 3 posts 20 karma points
    Mar 21, 2009 @ 12:12
    Nicolas
    0

    Grouping multiple nodes

    I'm new at Umbraco, and hitting a problem with XSLT.

    I've got a couple of nodes, i.e.
    [code]
    Day 1
    Day 2
    Day 3
    Day 4
    [/code]

    What I would like to achieve is an output like this:
    [code]


    Day 1, Day 2


    Day 3, Day 4

    [/code]

    The problem, of course, is that I have to open my div-tag on one node, and close it on another. When I try to do this, validation fails, and my XSLT won't render.

    I think there should be an easy solution for this, but I can't seem to find it using Google. Can any of you help me out here?

  • Petr Snobelt 923 posts 1534 karma points
    Mar 22, 2009 @ 14:16
    Petr Snobelt
    0

    Try use xslt text element and put div into cdata section

    Petr

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Mar 22, 2009 @ 15:48
    Dirk De Grave
    0

    Hi,

    I'm pretty sure you'll be using a for-each loop to loop through the nodes.
    In that case, use position(), first(), last() and modulo functions to determine whether you'd need to open, close a div element.

    [code]



    ...



    [/code](It's just a start here, written without testing...)

    Hope this helps.

    Regards,
    /Dirk

  • 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