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?

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
scroll top