I'm not a developer but still hoping to fix this little bug on our bilangual site. Our search functions well the first time it's used, but after the search, the URL field is prepopulated with a querystring that contains two language parameters. As a result, any subsequent search yields zero results. Does anyknow know where this insertion of parameters is 'controlled'?
You're right that the duplicate language parameter is coming from JavaScript. When the WoodWing search module processes the URL, it's appending the language parameter without checking if it already exists.
To fix this, modify the JavaScript that handles the search parameter updates. Add a check to remove any existing language parameters before appending the new one:
let url = new URL(window.location); url.searchParams.delete('lang'); url.searchParams.append('lang', currentLang);
Have you tried inspecting the WoodWing module's JavaScript to see where the duplication occurs?
Did my answer help? Please click "Mark as solution" — it helps others and means a lot to me!
I use my real experience, community knowledge, and expert tools (including AI when needed) to give the most accurate and human responses.
Muhammad Amjad
Senior Consultant • HubSpot + Web Automation Expert
hi @MuhammadAmjad, thanks for your explanation. Would you mind taking a look at the javascript I copied in this post and tell me where to insert this check? I'm not a developer and I'm therefore not sure if this check can be inserted as is, and where exactly. Thank you very much!
sorry, but that doesn't work. After the first search the page is not reloaded or anything, so the parameters in the URL are also not updated or removed.
Based on your code, the issue is likely in how you're building pagination URLs. When constructing the pageNumberParams in your JavaScript, you're using new URLSearchParams(params.toString()) which preserves all existing URL parameters, including any language parameters.
This may be because:
- Your pagination links are built by cloning the current URL parameters
- If a language parameter already exists in the URL, it gets preserved
- When the link is clicked, the language parameter may be added again
Could you please try the following: Before setting the offset parameter, ensure you're not duplicating language parameters. In your pagination function around line 200-250, modify how you create the pagination URLs:
let pageNumberParams = new URLSearchParams(params.toString()); pageNumberParams.set('offset', (i * updatedLimit)); // Remove any duplicate language parameters if they exist pageNumberParams.delete('lang'); // or whatever your language param is called
Alternatively, check if HubSpot's automatic language URL rewriting is interfering. You can disable this for specific elements by adding the class hs-skip-lang-url-rewrite to your pagination links.
I hope this helps!
Have a great day! Bérangère
This post was created with the assistance of AI tools.
Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.
Thanks for the suggested additional code. However, the result is still identical: 2 language parameters. Where would I have to add the class exactly? Is that also in the same piece of code share previously? Which line? Can you perhaps provide the sample code?
Hi @GvandenAkker and thanks for getting back to us! No worries at all, I’m not a programmer either, so you’re in good company! 😉
The hs get-started command is a streamlined CLI command that helps you quickly initialize and deploy a boilerplate project on HubSpot's developer platform.
It guides you through creating a project, configuring an app, uploading it to your account, and setting up local development.
According to the quickstart guide, after running hs get-started, you'll be prompted to select a project type (like App), name your project, set a local directory, and upload it to HubSpot.
The command handles dependency installation and initial deployment automatically.
The double lang parameter is most likely coming from the front-end, not WoodWing’s internal search engine.
You probably have a language-switcher or code that always appends lang=, even when the URL already has one.
The WoodWing server-side “Locale” config may be set correctly, but because of the duplicated parameter, the search request fails or is interpreted incorrectly.
Hey @GvandenAkker👋 Thanks for your post. @felixmacaspac is correct; without more details or access, it is challenging to give a definite answer to your question. — Jaycee
Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.
Hi @GvandenAkker it's hard to assume what would be the problem in this scenario, it would be best if you can contact a developer that can verify the HubL and the JavaScript of the module. The insertion might be coming from the HubL implementation or the JavaScript implementation.