CQWP that displays date

I got a request from a customer that wanted the Content Query Web Part to display Created (or Modified, whatevah) date along with the title. Why isn’t there a function for this already, and why why can’t you select any column you want to display in the web part? I’m not so impressed by this web part as you can tell 🙂 Well nevermind, moving on! I googled and found this nice description:

But instead of editing the itemstyle.xsl in Sharepoint Designer I copied the file and renamed it to itemstyle_lise.xsl and did all the customization in that file. Just to be sure that those customizations wont be lost in case of an upgrade or some other catastrophic scenario were all your work is lost! I am sure my Lise-file wont be overwritten 🙂

I added the CQWP to a page, exported it, opened it in Notepad and added some extra lines in it:

The above line points to my customized xsl stylesheet

The above line declares which default item style that should be displayed in the web part and I named my xsl template “Datum” inside the xsl file.

Saved the file as something else like “Datum.webpart” and imported it to the Sharepoint page, and now the webpart displayed my list with Date and Title.

Now you have your own customized web part and it wont effect the “default” web part:

Now to the deployment, and it’s here where my coding skills sucks – or are non existent to be honest – and therefore I always look for the quick & dirty solution at first and then maybe… I’ll ask my MVP collegue (yeah, he sits right next to me at the office – pure luxury) but that’s not the first thing I’ll do since I want to learn by doing. Trial and error, lovely. So my first thought is to upload it to the Web Part gallery under Site Actions, and put it in a group called “Lises web parts” or something.

The next, and real, step is to deploy it as a feature (I’ve been told by the dev pro’s here) and I will give it a shot!

0 0 votes
Rate this article!
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

oldest most voted
Inline Feedbacks
View all comments
Tobias Zimmergren

The dev pro’s, huh? 🙂
Good post, now just keep it up!
See you at breakfast!


Yeah and I am the admin pro 🙂