Copied to clipboard

Flag this post as spam?

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


  • matteo 4 posts 24 karma points
    Feb 11, 2011 @ 17:03
    matteo
    0

    how to group nodes sith same date

    Hello,

    my first post here, hope you don't mind...

    I implemented a very basic news section on a client's website and created a landing page with a simple macro that lists all the headlines.
    Now he's asking me to put different headers to separate posts from the same year.
    Like this:

    2011
    - post1
    - post2
    - post3

    2010
    - post4
    - post5

    2009
    ...

    How can I use xslt to automatically create the headers?
    That's how I would get the date:

    <xsl:value-of select="umbraco.library:FormatDateTime(data[@alias='Date'], 'yyyy')"/>

    What I don't know is how to show it only before the first post from the same year...
    I initially thought of manually create different directories on Umbraco for each year... that would be easy, but would also mean I'd need to manually update it next year, which I don't want to do.

    Any ideas?
    Please let me know if you wish more details

    thanks,
    Matteo

  • Lesley 284 posts 143 karma points
    Feb 12, 2011 @ 00:48
    Lesley
    0

    Hi Matteo,

    You may wish to look at the date folders package http://our.umbraco.org/projects/developer-tools/datefolders to automatically put the posts in folders for each year.

    This forum topic may also be of interest: http://our.umbraco.org/projects/collaboration/blog-4-umbraco/using-blog-4-umbraco/16917-Change-Date-Folder-Assignment

    Hope that helps

  • matteo 4 posts 24 karma points
    Feb 14, 2011 @ 12:28
    matteo
    0

    Hi Lesley,

    it looks definitely interesting, many thanks for your help

    Matteo

  • Dan 1288 posts 3921 karma points c-trib
    Feb 14, 2011 @ 12:55
    Dan
    0

    Hi Matteo,

    Welcome to our.umbraco!  This sounds like the exact same thing: http://our.umbraco.org/forum/developers/xslt/17142-Simple-Muenchian-grouping.

    Hope it helps...

Please Sign in or register to post replies

Write your reply to:

Draft