In Page I used search result to display items from Template, and this template contains "drop link field" I need to filter these results like that
I need to use "Current Item ID" in search scope to filter results, IS There a way to get Context Item in scope???
-
Can you add an example of what you're trying to do? What have you tried that doesn't work?– Dan SinclairMay 20, 2019 at 11:25
1 Answer
It is not possible out of the box. But you can add such functionality (extend the SXA) pretty easily by adding your own "search token" (adding a processor to one of SXA pipelines).
SXA can enrich search queries with Search Query Tokens. Take a look at exiting processors in resolveSearchQueryTokens
pipeline. What you want to achieve is almost the copy of the existing token - CurrentTemplate
(it is located here Sitecore.XA.Foundation.Search.Pipelines.ResolveSearchQueryTokens
).
There are some blog posts which can help you with, for example, this one: https://ggullentops.blogspot.com/2019/01/extending-sxa-search-query-tokens.html.