Nikolas361 Posted June 5, 2023 Posted June 5, 2023 Hey folks, I am trying to set up a bilingual 7.1 website in English and German (bieleit-medicus.com) and used the Brad Good method to do so. The code he provides places the language switcher above the header which looks a bit arbitrary and seems to collide in weird ways with a loading animation of @WillMyers that I use. So I wondered if anyone could help me with the code to place the language switcher in line with the header navigation, where it would be if I used the Weglot extension provided by Squarespace. Thanks for any help in advance! The code below is one I found in another post. But it seems that it was desgined for 7.0 and makes the language switch disappear for me: Quote <script> (function(){ window.addEventListener('DOMContentLoaded', () => { const switchBtn = document.querySelector('.language'); if(switchBtn) { const switchBtnDes = switchBtn.cloneNode(true); switchBtnDes.classList.add('language-desktop'); document.querySelector('.Header-search').insertAdjacentElement('beforeBegin',switchBtnDes) } }); })() </script> <style> .language:not(.language-desktop) { display: none; } .language.language-desktop { position: static; order: 5; } </style> antovicodg 1
Nikolas361 Posted June 7, 2023 Author Posted June 7, 2023 On 12/29/2022 at 10:43 AM, tuanphan said: #1. Add to Design > Custom CSS span.current-language-name { border-bottom: 1px solid; } #2. I don't know this #3. What should it look like? Hey @tuanphan, do you maybe also know how to underline the current language for a coded language switch (Brad Good method) that isn't in the nav bar? site: bieleit-medicus.com Thanks lots! Best, Nikolas
Solution tuanphan Posted June 9, 2023 Solution Posted June 9, 2023 On 6/7/2023 at 3:22 PM, Nikolas361 said: Hey @tuanphan, do you maybe also know how to underline the current language for a coded language switch (Brad Good method) that isn't in the nav bar? site: bieleit-medicus.com Thanks lots! Best, Nikolas It is possible, but I don't know any simple codes You can use this code, a bit manually Add to All EN pages Header <style> div.language>a.lang-en { border-bottom: 2px solid; } </style> Add to All De Pages Header <style> div.language>a.lang-de { border-bottom: 2px solid; } </style> Nikolas361 1 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!)
Nikolas361 Posted June 9, 2023 Author Posted June 9, 2023 oh I realize that I asked the underlining question under the wrong topic. Intended to respond to a post on that subject. Sorry for the confusion everyone. If anybody finds a solution to the nav bar placement of the switcher, let me know ^^
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment