Change Instagram accounts links when changing language

Highlighted
New Member
1 0 0

Hi everyone,

At the bottom of my web I give the option to the user to choose between English (default) and Spanish. I have two Instagram accounts set in both languages and I would like the links of both of them to change when the web language is also changed. In other words, when user goes and select Spanish as a language, I want the Instagram link to take me to the Spanish account when clicking on it, but if the user does not change the language, I want the Instagram link to take them to the English account

I have modified the code and I do not have any error, but it does not do anything. Could anyone shed some light on this? My code is as follows:

{% if settings.social_instagram_link != blank %}
              {% case attributes.lang %}
                  {% when 'en' %} 
                    <li>
                      <a href={{ settings.social_instagram_link | escape }}" title="{{ 'layout.footer.social_platform' | t: name: shop.name, platform: 'Instagram' }}">
                        <span class="icon icon-instagram" aria-hidden="true"></span>
                        Instagram
                      </a>
                    </li>                
                  {% else %}
                    <li>
                      <a href="https://www.instagram.com/example/" title="{{ 'layout.footer.social_platform' | t: name: shop.name, platform: 'Instagram' }}">
                        <span class="icon icon-instagram" aria-hidden="true"></span>
                        Instagram
                      </a>
                    </li>
              {% endcase %}
              {% endif %}

 

Thanks a lot in advance! 

Note: I attach an screenshot just in case is of any help.

Coding.png

 

 

 

 

 

0 Likes