SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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.