Berichten

CQWPPagingElements

Content Query Web Part Paging

Working with the Content Query Web Part (CQWP) in SharePoint 2010 I was wondering how to add paging controls to display e.g. only 10 items.

After some research I found this article from Waldek:

http://blog.mastykarz.nl/sharepoint-2010-content-query-web-part-paging/

Nice solution, but I didn’t want to add a .wsp, make it more adaptable for myself and tried to achieve really simple paging functionality by using JavaScript.

I used the effects of this paging list, but made it really minimal:

http://demo.tutorialzine.com/2010/05/sweet-pages-jquery-pagination-solution/demo.html

This is the final result:

[fancy_box]

[/fancy_box]

[download_box]

Paging JavaScript and CSS code
[/download_box]

1 thing I noticed was, I had to change the ContentQueryMain.xsl to fit the right format:

[fancy_box]

[/fancy_box]

[fancy_box]

[/fancy_box]

Output:

[fancy_box]

[/fancy_box]

I defined the <li> elements in the ItemStyle.xsl:

[fancy_box]

[/fancy_box]

[fancy_box]

[/fancy_box]

It’s that simple! Paging in a CQWP with a nice sliding effect.

If you don’t want to change your ContentQueryMain.xsl then you have to export the CQWP and reference to your own custom .xsl file.

Thanks!