Hi, I am trying to target language-specific search results in the hubspot search function on this site https://www.cogencyglobal.com/en-gb/ at the moment it shows everything on the us site and uk site when using the site search functions.
You can clone the "Site Search Input" module to create your own custom search and add in hidden inputs to specify parameters. So you could add in the limit like this:
What I'm struggling a little with is setting the language condition to check for the page language. In theory you should be able to use content.language.languageTag to get the language like this:
Oct 3, 202410:16 AM - edited Oct 3, 202410:23 AM
Member
Multilingual search function
SOLVE
Hi Dan, Maybe I'm a little late (I've only been on hubspot for 2 weeks) but I have a good solution for your question regarding multilingual search : 1) just create an empty web page. The slug maybe /search or /en/search for example
2) add two modules by drag&drop : Search Input and Search Result
3) in the parameters of the Search Input you can choose on which page you want to see your result => choose this page : this the most important point. In the end you won't need to use the global prameter regarding the search result if you do that on every search input you have on your website.
4) you can create as many multilingual page of this page as needed. Obviously you will have to change the search result page in the parameter of the search input module of each page to match with the right language.
That's it!
To improve the solution, you can clone the module search Input to add a filter '?language=xxx' to ensure that each search input will search only in the language of the page. I did this to avoid multiple results for the same blog with different languages. Example : Blog Quadza Software
Oct 3, 202410:16 AM - edited Oct 3, 202410:23 AM
Member
Multilingual search function
SOLVE
Hi Dan, Maybe I'm a little late (I've only been on hubspot for 2 weeks) but I have a good solution for your question regarding multilingual search : 1) just create an empty web page. The slug maybe /search or /en/search for example
2) add two modules by drag&drop : Search Input and Search Result
3) in the parameters of the Search Input you can choose on which page you want to see your result => choose this page : this the most important point. In the end you won't need to use the global prameter regarding the search result if you do that on every search input you have on your website.
4) you can create as many multilingual page of this page as needed. Obviously you will have to change the search result page in the parameter of the search input module of each page to match with the right language.
That's it!
To improve the solution, you can clone the module search Input to add a filter '?language=xxx' to ensure that each search input will search only in the language of the page. I did this to avoid multiple results for the same blog with different languages. Example : Blog Quadza Software
You can clone the "Site Search Input" module to create your own custom search and add in hidden inputs to specify parameters. So you could add in the limit like this:
What I'm struggling a little with is setting the language condition to check for the page language. In theory you should be able to use content.language.languageTag to get the language like this: