Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I need to diplay the result of my content query webpart as follows:
Date modified 1
Title
Title
Date modified 2
Title
Title
Title

I know you can't do a group by on the last modified date in de content query webpart. And to be frank, I really don't want to mess up my content type by using the solution that was given here (no offense, i just like a clean content type).

Is there anyway I can do the same using my custom XSL file?

share|improve this question
add comment

1 Answer

You can group your items using Muenchian Method:

Put this line outside of the xsl templates:

<xsl:key name="ByDate" match="Row" use="@YourDateColumn"/>

And draw your items like this:

<xsl:for-each select="//Row[generate-id() = generate-id(key('ByDate', @YourDateColumn)[1])]">
    --- Draw group header ---
    <xsl:for-each select="key('ByDate', @YourDateColumn)">
        --- Draw item ---
    </xsl:for-each>
</xsl:for-each>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.