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:
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
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
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
Hi Lesley,
it looks definitely interesting, many thanks for your help
Matteo
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...
is working on a reply...