1

I'm trying to set up a top level site that displays every Project site, creating a basic navigation. To achieve this I used a Search Result Webpart with a custom query, providing me with the correct results:

    Path:"{\Site.URL}/*/"
    contentclass:STS_Web 
    WebTemplate:PROJECTSITE

However, sites with the correct WebTemplate may become subsites of the Project sites in the future:

/Project1/Subproject1

These subprojects are not supposed to be shown in my navigation, is there any way to exclude them and all future subprojects without hardcoding the names?

2
  • If you wanna avoid showing any subsites and just like to return sitecollections, switch content class to contentclass=STS_Site. Apr 11, 2016 at 14:11
  • I do want to show subsites, just not below the first level.
    – Raijen
    Apr 11, 2016 at 16:37

1 Answer 1

0

You can control the depth with the UrlDepth property.

So try to change your syntax to something like this:

Path:{Site.URL} UrlDepth=1

See tip 2 on this blog.

Display a Sub Site list using a Content Search Web Part

4

Your Answer

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

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