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 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?

share|improve this question
1  
Are they linked to one specific announcements lists the different CQWP, like CQWP1 is getting items from ListA, CQWP2 from ListB etc? –  Anders Aune Apr 3 '12 at 9:56
add comment

2 Answers

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.

share|improve this answer
add comment

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.

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.