Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

CSS class of footer navigation items for language switcher


immiike

Question

Site URL: https://mikala.ch

Dear community

I've used a code injection to enable multi-language setup of my site. Now I wanted to add two basic links to the the footer middle block to let user change the language of the site. These links should be in the same css class as the footer navigation items so that if the design gets changed, the language switcher links are also changed.

Does anyone know how to do that?

Many thanks in advance for your help!

 

Link to post
  • Answers 4
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Posted Images

4 answers to this question

Recommended Posts

  • 0

Add to last line in Code Injection Footer, code from this guide.

<script>
/*setup language switcher*/
$('.Footer-middle').prepend('<div class="language"><a href="/en/home" class="lang-en">English</a> | <a href="/es/acceuil/" class="lang-es">Español</a></div>');
</script>

then add this to Home > design > Custom CSS

.language {
    text-align: center;
}

 

Edited by tuanphan

You can send your question to my email to get detail answer. / How to Setup Password & Share URL

--- Happy New Year

Link to post
  • 0

Thanks @tuanphan

your code got me the language switcher in the footer middle block, but it didn't take over the same CSS class as the footer navigation items. Is there a way where I can get the language switcher as the same class as the footer navigation items, so if the style of the footer navigation is changed, the language switcher gets changed as well?

image.thumb.png.565e17082ec307ca6fe969b563fda931.png

Link to post
  • 0
6 minutes ago, immiike said:

Thanks @tuanphan

your code got me the language switcher in the footer middle block, but it didn't take over the same CSS class as the footer navigation items. Is there a way where I can get the language switcher as the same class as the footer navigation items, so if the style of the footer navigation is changed, the language switcher gets changed as well?

 

edit script code to

<script>
/*setup language switcher*/
$('.Footer-middle').prepend('<div class="language"><a class="Footer-nav-item" href="/en/home" class="lang-en">English</a> | <a class="Footer-nav-item" href="/es/acceuil/" class="lang-es">Español</a></div>');
</script>

 

You can send your question to my email to get detail answer. / How to Setup Password & Share URL

--- Happy New Year

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...