Spence500 Posted May 28, 2022 Share Posted May 28, 2022 (edited) Site URL: https://www.lmtecdigitalsolutions.com/en/home Hi, my German translated mobile menu seems to have taken on some content from my english translated website. I'm using a language switcher on my website, the main language is English while German is secondary. In both the German and English headers on Desktop view, the two have the correct elements that I want displayed, however when I switch my German translated website into mobile view, the mobile menu has 2 extra elements that are supposed to only be available in the English mobile menu. The way I worded this sounds a bit confusing, so I'll link some screenshots. The "Industries" and "Offerings" folders/pages shouldn't be inside the German Mobile Menu, but somehow it is. Then if you click on one of them, it sends you to the English webpage. I want to get rid of those elements in the German Mobile Menu. Edited May 28, 2022 by Spence500 Adjusted Title Link to comment
tuanphan Posted May 29, 2022 Share Posted May 29, 2022 First, edit this line if (lang == "de") { $('a[href="/"]').attr("href", "/de/startseite"); // $('a[href="/contact"]').text('Kontakt'); // $('a[href="/contact"]').attr("href", "/de/kontaktieren"); $('[data-section-id="6037b4574142e82bebbf3cc6"]').hide(); $('[data-section-id="6037b464ac60715d509ea18f"]').hide(); $('.header-menu-controls-control span:nth-child(2)').text('retour'); } to this if (lang == "de") { $('body').addClass('body-de'); $('a[href="/"]').attr("href", "/de/startseite"); // $('a[href="/contact"]').text('Kontakt'); // $('a[href="/contact"]').attr("href", "/de/kontaktieren"); $('[data-section-id="6037b4574142e82bebbf3cc6"]').hide(); $('[data-section-id="6037b464ac60715d509ea18f"]').hide(); $('.header-menu-controls-control span:nth-child(2)').text('retour'); } Next, add this to Code Injection > Header <!-- Hide items from DE Pages --> <style> body.body-de div.container.header-menu-nav-item:not(.lang-de) { display: none; } </style> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Spence500 Posted May 30, 2022 Author Share Posted May 30, 2022 On 5/29/2022 at 4:59 AM, tuanphan said: First, edit this line if (lang == "de") { $('a[href="/"]').attr("href", "/de/startseite"); // $('a[href="/contact"]').text('Kontakt'); // $('a[href="/contact"]').attr("href", "/de/kontaktieren"); $('[data-section-id="6037b4574142e82bebbf3cc6"]').hide(); $('[data-section-id="6037b464ac60715d509ea18f"]').hide(); $('.header-menu-controls-control span:nth-child(2)').text('retour'); } to this if (lang == "de") { $('body').addClass('body-de'); $('a[href="/"]').attr("href", "/de/startseite"); // $('a[href="/contact"]').text('Kontakt'); // $('a[href="/contact"]').attr("href", "/de/kontaktieren"); $('[data-section-id="6037b4574142e82bebbf3cc6"]').hide(); $('[data-section-id="6037b464ac60715d509ea18f"]').hide(); $('.header-menu-controls-control span:nth-child(2)').text('retour'); } Next, add this to Code Injection > Header <!-- Hide items from DE Pages --> <style> body.body-de div.container.header-menu-nav-item:not(.lang-de) { display: none; } </style> Wow, thank you so much my friend, I really appreciate you always helping me out, it works great! Link to comment
Dimasua Posted October 31, 2022 Share Posted October 31, 2022 On 5/30/2022 at 8:39 PM, Spence500 said: @Spence500 Can you please share where are you supposed to edit the line in the code that @tuanphan suggested to edit? Link to comment
tuanphan Posted November 4, 2022 Share Posted November 4, 2022 On 10/31/2022 at 9:41 PM, Dimasua said: Can you please share where are you supposed to edit the line in the code that @tuanphan suggested to edit? If you have problem, you can describe in detail + share site url, we can help easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment