Building a navigation with a search result webpart
-
08-10-2020 - |
Вопрос
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.
Не связан с sharepoint.stackexchange