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 a webpartpage with two CQWPs. I want the first to show all pages for the current site, and I want the second to show all pages for the subsites of the current site.

As I can see, there's no way of excluding the current site's pages in the second CQWP OOTB, but is there a way to filter e.g. in the xslt?

I'm deploying the webparts through a feature, and I have full control of the webparts properties and xslt.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Solved this using xslt. Used the 'trick' described here to get the current page. I then found the current sitename from this url. I then appended '/Pages' to the current site's name, and for alle the returned pages I checked if there LinkUrl-field contiained currentsite/Pages, and did not show them id they did.

Not an optimal solution of course. This will for instance not work if you have subsites with the same urlname as the CQWP-site.

share|improve this answer

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.