I have a news home page with an archive page and date folders beneath. I cannot seem to get the date folder contents for the archive page which is at the same level. Should I move my date folders under my archive page? I'd rather not have to hard code a starting node ID.
<xsl:template match="/"> <ul> <!-- Iterate over all nodes with a year-id similar to the first in every group --> <xsl:for-each select="$currentPage/parent::* [@isDoc] [(generate-id() = generate-id(key('years', Exslt.ExsltDatesAndTimes:year(@updateDate))[1]))]"> <xsl:sort select="@updateDate" order="descending" /> <li> <xsl:value-of select="Exslt.ExsltDatesAndTimes:year(@updateDate)" /> <ul> <xsl:variable name="months" select="key('years', Exslt.ExsltDatesAndTimes:year(@updateDate))" /> <!-- Iterate over all nodes with a month-id similar to the first in every group --> <xsl:for-each select="$months[generate-id() = generate-id(key('months',umbraco.library:FormatDateTime(@updateDate, 'yyyy-MM'))[1])]"> <xsl:sort select="@updateDate" order="ascending" /> <li> <xsl:value-of select="umbraco.library:FormatDateTime(@updateDate, 'MM')"/> <ul> <!-- Iterate over all nodes in a group, i.e. with the same months-key --> <xsl:for-each select="key('months',umbraco.library:FormatDateTime(@updateDate, 'yyyy-MM'))"> <xsl:sort select="@updateDate" order="ascending" /> <li> <xsl:value-of select="umbraco.library:LongDate(@updateDate)"/> : <xsl:value-of select="@nodeName" /> </li> </xsl:for-each> </ul> </li> </xsl:for-each> </ul> </li> </xsl:for-each> </ul> </xsl:template> </xsl:stylesheet>
I'm using auto folders, and yes, in the backend things are grouped. But the output is not grouped. I am trying to output the contents of the auto folders.
How to get children of parent
I have a news home page with an archive page and date folders beneath. I cannot seem to get the date folder contents for the archive page which is at the same level. Should I move my date folders under my archive page? I'd rather not have to hard code a starting node ID.
Currently:
Home
- - News
- - - - News Archives
- - - - 2011
- - - - - - 12
- - - - - - 11
- - - - - - 10
- - - - 2010
- - - - - - 12
- - - - - - 11
you can by $currentPage/../Archive//NewsItems
Not working.
I'm trying to group by year and month the content nodes that are in a sibling node. This gives me no results.
why you won't work with the datefolders? it's already grouped for you.
I'm using auto folders, and yes, in the backend things are grouped. But the output is not grouped. I am trying to output the contents of the auto folders.
Solved.
is working on a reply...