Hey everyone,
Eugene from Weglot here. We are working on a specific support doc to explain how to position your language switcher on Webflow (it will be done soon). Here is the gist of it:
First option:
You can create a div where you want the Weglot switchers to be and add the following id to it: weglot_here
. This should place the Weglot switcher in the desired position.
Second option:
In order to add the Language Switcher to your menu, you can use the “Switchers” option to add to your Weglot.initialize
code as you can see attached and in the documentation below
-----> Options - Weglot
See the example below:
<script>
Weglot.initialize({
api_key: 'YOUR_API_KEY',
switchers: [
{
// Same as button_style at root
button_style: {
full_name: true,
with_name: true,
is_dropdown: false,
with_flags: true,
flag_type: "circle",
invert_flags: false
},
// Move switcher somewhere in the page
location: {
target: ".header-nav",
sibling: null
}
}
]
});
</script>
Then, you will just have to replace the target element (".header-nav"
) by the CSS selector of the parent element where you want the language switcher to be placed.
For instance, if you want to add it to your menu:
<nav class="menu">
Your target line will be:
target: ".menu",
Third option:
Finally, another option to move the button will be to create languages elements into your native menu and link it with the translation hooks below
----> Language link Hooks - Weglot
For instance, you create a “Languages” item menu with “English” and “Français” as sub-menu.
English will have the link #Weglot-en
and “Français” will have the link #Weglot-fr
If you need any help, don’t hesitate to contact our support team: support@weglot.com
They’ll be happy to help you 