Pnp-modern-search: Query Data Source: Page Properties

Created on 11 Sep 2020  路  4Comments  路  Source: microsoft-search/pnp-modern-search

We'd like a search results web part that is on a Modern Page that is saved as a template. When future pages are created from this template, the query the results web part uses is based on one or more Page Properties set on the current page.

This web part would then show "similar" pages, identified by a page property that the page author has set.

This would be configured similar to the existing "Site properties" selection, but would instead be called "Page properties", and the next dropdown would be a selection of properties available on the current page.

All 4 comments

Perfect, thanks! The {Page.} syntax should do exactly what we're after.

If you want Page properties to be available via Dynamic Data, that's a SPFx request :)

Gotcha, so PnP isn't doing anything specifically custom for the Dynamic Data selection, only using what SPFX exposes?

Like I say, for my specific use-case, updating the QueryTemplate with the Page Property will be perfectly fine. Should've read the docs instead of looking at the UI and thinking "that's the only option"! :)

Was this page helpful?
0 / 5 - 0 ratings