I have two content query web parts each linked to a different announcements list.

I'm showing the most recent five announcments and would like to have a 'View all' link at the bottom.

I've found a way to hard code a link at the bottom, but I'd like for it to pull in the Title URL so I don't have to manually code the link for each CQWP that I might place on the page.

Any ideas?

  • 1
    Are they linked to one specific announcements lists the different CQWP, like CQWP1 is getting items from ListA, CQWP2 from ListB etc? Apr 3, 2012 at 9:56

2 Answers 2


I'm not 100% sure if the default CBQWP supports what you want out of the box, but if you're doing any other custom development in your solution you could provide a web part that inherits from ContentByQueryWebPart, and push through the ListUrl property into to the XSLT by overriding the ModifyXsltArgumentList() method. You can then customise the XSLT for ContentQueryMain.xsl (or, preferably, create a copy of it) to show the View All link. You'd then need to retrofit all current webparts where you want this functionality to be used.


With javascript (jQuery for example) you can pretty easily grab the Title URL of a web part and after that modify the URL of the "View all" link at the footer.

Few months after this question I had to implement the same in my project, and I blogged the solution here. Basically I use jQuery to find the correct CQWP, then find the list it links within CQWP and append a "Read more" type of link as the last item.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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