0

We are using SXA 1.8 with Sitecore 9. And, we have the requirement to access the search keyword passed in the search-box in one of the custom-renderings. But unfortunately, SXA is appending the search keyword in URL hash instead of Query-string. So, its difficult to access the search term in the controller code. I found it is not possible to change from Hash to Query-string as per this link Changing hash to query string.

So, I just want to know is there any better way to access the search term in custom controller. Any suggestions?

0

The SXA is storing the search phrase in hash only on the front-end. This param is later on processed in component-search-service.js and base on the rest of things from the hash and some default settings of the renderings we are building the URL. It contains the following query parameters:

enter image description here

As you see the q is there and you can use it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.