We have an SXA Search box defined on a partial design in our Master Shared site. The problem is we need to have the SearchPageResults rendering parameter field use a query to pull the search results page relevant to the derived host site, but it seems that setting the SearchPageResults to a query value such as query:$home/search-results doesn't work. It doesn't resolve to the proper search results page when viewed from a derived site with the the search-results page existing in that specific place.
I've done some reading; I don't believe rendering parameters support Sitecore queries syntax with SXA tokens, or at least the SXA components don't from what I can tell. I was talking to some team members and they suggested I could set up the SXA Token pipelines to handle the Rendering Parameters for the component.
However, Googling and digging through Sitecore documentation has only gotten me so far. I would think the following configuration would work for what I'm trying to do:
<pipelines> <getLookupSourceItems> <processor type="Sitecore.XA.Foundation.Multisite.Pipelines.ResolveTokens.ResolveMultisiteTokens, Sitecore.XA.Foundation.Multisite" resolve="true"/> <processor type="Sitecore.XA.Foundation.Presentation.Pipelines.ResolveTokens.ResolvePresentationTokens, Sitecore.XA.Foundation.Presentation" resolve="true" /> <processor type="Sitecore.XA.Foundation.Theming.Pipelines.ResolveTokens.ResolveThemingTokens, Sitecore.XA.Foundation.Theming" resolve="true" /> <processor type="Sitecore.XA.Foundation.TokenResolution.Pipelines.ResolveTokens.CurrentTemplateToken, Sitecore.XA.Foundation.TokenResolution" resolve="true" /> <processor type="Sitecore.XA.Foundation.TokenResolution.Pipelines.ResolveTokens.EscapeQueryTokens, Sitecore.XA.Foundation.TokenResolution" resolve="true" /> </getLookupSourceItems> </pipelines>
Any ideas on how I can get this to work? Am I on the right track? Perhaps there's a simpler way of accomplishing this that I'm not seeing.
Looking at a note on the ticket, I see I may have left out some details. Let me try again.
I have my search box inside a partial design that is located in my shared site "Master". The search box component has a Rendering Parameter named SearchResultsPage, which points to the search results page it should redirect it's query to. I tried to pass the parameter "$home/search-results", which is where the page will be on every derived site of "Master", such as my derived site "QA."
The problem is, when I set this value on the partial design in "Master", it doesn't work on my derived site "QA". I'm not redirected to my relative search results page path from the QA site, I'm just taken to the same page with the fields relevant to the query updated past the hash. It would seem the relative path I set in the "Master" partial design isn't being resolved properly on the child "QA" site.
Note: the search-results page doesn't exist on "Master", so I don't expect this to work in the context of working with the "Master" site itself, such as editing the partial design in the "Master" site in Experience Editor. The issue I'm having is it's not resolving on my derived "QA" site.
Let me know if anything here isn't clear.