question

ChristianDias-SIL avatar image
0 Votes"
ChristianDias-SIL asked CaseyYangMSFT-4714 commented

Custom query that will fetch managed property value and show pages with similar values in a Hightlighted content WebPart

I've tagged/categorized all site pages in my SharePoint site and would like to add a highlighted content WebPart with a custom query that is able to check what values are in the managed property and then filter any site pages with those same values.

Example:
A site page containing highlighted content WebPart, with the value "Outlook" as one of its managed properties will show all site pages also containing "Outlook" as a value in their managed properties.

Currently, I only have a static way of setting this Query. I've mapped the crawl to a managed property and it works but I would like for it to be able to get the value first and then filter those pages automatically.

The below is the custom query I use.

RefinableString00: Outlook

Any ideas?

Thanks in advance

office-sharepoint-online
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for your question. We are currently looking into this issue and will give you an update as soon as possible. Thank you for your understanding and support.

0 Votes 0 ·
ChristianDias-SIL avatar image
0 Votes"
ChristianDias-SIL answered CaseyYangMSFT-4714 commented

Hi @CaseyYangMSFT-4714,

Thanks for your response.

I was at an impasse where I could only input the value manually. By value, I meant a static value to search for in the query but what I was looking for was a more automatic approach as I wanted to create a Site Page template.

I managed to figure out how to do this. Using PnP Modern Search Results WebPart and the following text query, {|RefinableString00:{Page.WikiCategory}}. It identifies the values in a managed property of the current page and queries pages with the same values of that managed property, WikiCategory.

I created a template Site Page with the WebPart pre-configured so any time a page is created, tagged with a value in the managed property and published it will show automatically all pages that are "related content".

Thanks,
Christian Dias

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @ChristianDias-SIL,

Congratulations on solving this issue and thanks for sharing your solution.

0 Votes 0 ·
CaseyYangMSFT-4714 avatar image
0 Votes"
CaseyYangMSFT-4714 answered ChristianDias-SIL converted comment to answer

Hi @ChristianDias-SIL,

What do you mean " a static way of setting this Query"?

Per my research, when you use custom query Hightlighted content WebPart will list all pages that contain "Outlook".

For Reference:
https://support.microsoft.com/en-us/office/use-the-highlighted-content-web-part-e34199b0-ff1a-47fb-8f4d-dbcaed329efd


If an Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @ChristianDias-SIL,

I'm checking how the things are going on about this issue. Is there any progress on this issue?

0 Votes 0 ·