sp-starter-kit icon indicating copy to clipboard operation
sp-starter-kit copied to clipboard

Would it make sense to replace the People Directory Web part with PnP Modern Search Web parts?

Open kasperbolarsen opened this issue 1 year ago • 5 comments

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/

kasperbolarsen avatar May 22 '23 11:05 kasperbolarsen

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar May 22 '23 11:05 ghost

Intriguing idea, it could be a great addition to the project.

  1. I'd like to see us keep the existing people search webpart as it is still a good technology demonstrator. Doesn't hurt.
  2. 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?

eoverfield avatar May 22 '23 16:05 eoverfield

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 :-)

kasperbolarsen avatar May 22 '23 16:05 kasperbolarsen

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 ?

kasperbolarsen avatar May 24 '23 22:05 kasperbolarsen

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.

eoverfield avatar May 24 '23 23:05 eoverfield