sp-starter-kit
sp-starter-kit copied to clipboard
Would it make sense to replace the People Directory Web part with PnP Modern Search Web parts?
Category
- [x] Question
Question
I am wondering if it would make sense to replace the People Directory web part ( or keep both ) with a fully configured PnP Modern Search Web part like this one: https://microsoft-search.github.io/pnp-modern-search/scenarios/Create-a-useful-People-Search/
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Intriguing idea, it could be a great addition to the project.
- I'd like to see us keep the existing people search webpart as it is still a good technology demonstrator. Doesn't hurt.
- Creating a new page within the provisioning template that deploys the Modern Search webpart, pre-configured, would be very cool as well. It aligns well with this project as we want to demonstrate multiple approaches to provisioning customized solutions.
We would need to install the Modern Search sppkg along with the rest of the bundles, similar to our approach to MGT. That shouldn't be a concern as PnP Provisioning as used in this solution will not overwrite an existing sppkg.
@kasperbolarsen is this a PR you'd be interested in submitting?
I am deploying the PnP Modern Search almost by default as one of the steps in our Provisioning offerings, all based on the PnP Provisioning Engine. So yes, I would be happy to promote Modern Search by adding it to the Starter Kit :-)
I have just deployed the starter kit on a brand new tenant, and it sure looks like the page /sites/contosoportal/SitePages/People-Directory.aspx already exists and currently isn't in use. Can I grab that page for the PnP Modern Search version of the People Directory ?
sounds likes a great plan to me. The provisioning template adds quite a few mostly blank pages as inspiration. Building more of these out would be a great addition.
You likely found this code, though in case you haven't or others are interested, within the provisioning template, you will find the following:
<pnp:ClientSidePage PageName="People-Directory.aspx" Title="People Directory" Layout="Article" PromoteAsNewsArticle="false" Overwrite="true" EnableComments="false" Publish="true">
<pnp:Header Type="Custom" ServerRelativeImageUrl="{site}/SiteAssets/page-people-directory.jpg" TranslateX="50.1336183858899" TranslateY="30" />
</pnp:ClientSidePage>
You can add <pnp:Section /> and <pnp:Controls /> objects to the above ClientSidePage, then within a <pnpCanvasControl /> referencing the proper controlid (webpart id), you can add and configure the proper Search webparts. You will need to add the search sppkg to the app catalog within the <pnp:AppCatalog /> object, and also add the sppkg to the actual project, I suggest you follow the approach we used for mgt, i.e. ./source/mgt-spfx.
Looking forward to the PR.