Using custom slot in query template #4174
-
I apologize if this has been addressed, but I didn't find it in search. In the Search Results webpart, can I use a custom slot in the query template? ChatGPT say yes, with the syntax {?customSlotName} and Copilot says yes with a syntax of {customSlotName}, but neither seem to work. Scenario: I have a customSlot named MyCategory. Its value is a string, e.g., "Technology." I use this custom slot in my display template in several places. I also have the following in my query template: Category:"Technology" In this example, {Site.URL} work perfectly. I would like to do the same with {MyCategory} Thanks! -Don |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi Don, You can find additional Layout samples as https://github.com/microsoft-search/pnp-modern-search-layouts/tree/main/Results/Handlebars/ for inspiration :-) |
Beta Was this translation helpful? Give feedback.
-
Thanks Kasper, that worked perfectly. I love community!
…________________________________
From: Kasper Larsen ***@***.***>
Sent: Friday, December 27, 2024 8:14 AM
To: microsoft-search/pnp-modern-search ***@***.***>
Cc: Don Kirkham ***@***.***>; Author ***@***.***>
Subject: Re: [microsoft-search/pnp-modern-search] Using custom slot in query template (Discussion #4174)
Hi Don,
It sounds like you are looking for something like this:
{{slot item @root.slots.QuickLinkBoxText}}
where QuickLinkBoxText is one of my custom Slots.
You can find additional Layout samples as https://github.com/microsoft-search/pnp-modern-search-layouts/tree/main/Results/Handlebars/ for inspiration :-)
—
Reply to this email directly, view it on GitHub<#4174 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACB3AT45UGCKHAVVWSEISC32HVOERAVCNFSM6AAAAABUIUYQCSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRXG43TEOI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Hi Don,
It sounds like you are looking for something like this:
{{slot item @root.slots.QuickLinkBoxText}}
where QuickLinkBoxText is one of my custom Slots.
You can find additional Layout samples as https://github.com/microsoft-search/pnp-modern-search-layouts/tree/main/Results/Handlebars/ for inspiration :-)