Different Logo for Different Language

More
9 months 4 weeks ago - 9 months 4 weeks ago #163957 by benjaminschlegel
benjaminschlegel created the topic: Different Logo for Different Language
I am trying to expend the theme fruity. My goal is to display a different logo depending on the chosen language. I am updating the custom nav_bar.twig. I tried the following code, where I also tried {{ SURVEYLANG }}, { SURVEYLANG }, in small letters, with surveylanguage Capital and small letters and LANG in call variations.
        {# Logo option #}
        {% if( aSurveyInfo.options.brandlogo == "on") %}
            <div class="{{ aSurveyInfo.class.navbarbrand }} logo-container hidden-xs"  {{ aSurveyInfo.attr.navbarbrand }}  >
				{% if( SURVEYLANG  == "fr") %}
					{{ image( "./files/logo_fr_quer.png", 'anytext', {"class": "logo img-responsive"}) }}
				{% else %}
					{{ image( "./files/logo_de_quer.png", 'anytext', {"class": "logo img-responsive"}) }}
				{% endif %}
            </div>
        {% else %}
            <div class="{{ aSurveyInfo.class.navbarbrand }}"  {{ aSurveyInfo.attr.navbarbrand }} >
                {{ aSurveyInfo.name }}
            </div>
        {% endif %}

Does anyone know how I can do this?

Edit: I'm using Limesurvery 3.0.0.
Last Edit: 9 months 4 weeks ago by benjaminschlegel.

Please Log in or Create an account to join the conversation.

More
9 months 4 weeks ago #163966 by tpartner
tpartner replied the topic: Different Logo for Different Language
Try this for your IF statement:

{% if( aSurveyInfo.surveyls_language  == "fr") %}
    {{ image( "./files/logo_fr_quer.png", 'anytext', {"class": "logo img-responsive"}) }}
{% else %}
    {{ image( "./files/logo_de_quer.png", 'anytext', {"class": "logo img-responsive"}) }}
{% endif %}

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: benjaminschlegel

Please Log in or Create an account to join the conversation.

More
9 months 4 weeks ago - 9 months 4 weeks ago #163968 by benjaminschlegel
benjaminschlegel replied the topic: Different Logo for Different Language
Thanks a lot, that worked!
Last Edit: 9 months 4 weeks ago by benjaminschlegel.

Please Log in or Create an account to join the conversation.

More
9 months 4 weeks ago #163978 by tpartner
tpartner replied the topic: Different Logo for Different Language
For reference...in most template Twig files, you can see all available variables in the aSurveyInfo array by setting debug to 1 and placing this somewhere in the Twig file:

{{ dump(aSurveyInfo) }}

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!