Mar 30 2023 05:11 AM
Hello,
In my tenant there is one HubSite "MainHubSite". And there are some other communications sites A,B,C,D,E,F,G,H etc. which are associated with "MainHubSite".
My requirement is on Homepage of "MainHubSite", I want to have interface where I can search associated site's name and below that it will show result accordingly. If nothing is searched then it should display all the associated sites. Now, what I did is = On homepage of "MainHubSite", I am using "PnP search box" and "PnP search results" webparts. And below that I am using "Sites" webpart where I am successfully able to display all associated sites. But when I search something in PnP Searchbox, I am not getting those associated sites.
I am using query "{searchboxquery} Sites contentclass: STS_Site " in PnP search result webpart's query parameter. Here, Sites is name of Sites webpart. (I should fetch associated sites from sites webpart or not I am not sure)
Can anyone please help me to get this resolved? I tried so many things but unable to understand where it's going wrong. Thanks in advance!
@ganeshsanap sir tagging you if you can help. Thanks :)
Mar 30 2023 06:11 AM
Solution@iamajaythakur Instead of using "Sites" in search query, use hub site DepartmentId as mentioned in this thread: How can I search for sites within my hub using PnP Modern Search?
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
Apr 05 2023 05:00 AM
Apr 06 2023 03:20 AM