Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Toggle between templates based on language

More
7 years 4 months ago #168106 by krosser

tpartner wrote:

Unfortunately, this code did not work for me. Tried it in Vanilla and Bootswatch and it does not show any logos.

It looks like you did not upload the images to the correct location or with the wrong names.


Oh yes, sorry, you are right. I incorrectly wrote the file names (logo_eng.png instead of logo-eng.png). My bad... :silly:
So, it works in both themes.

I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
The topic has been locked.
More
6 years 9 months ago - 6 years 9 months ago #177376 by rikatechdoku

tpartner wrote: Here is an example of how to use an IF statement to render a language-dependent logo image:

Code:
{# Logo option #}
{% if( aSurveyInfo.options.brandlogo == "on") %}
 
  <div class="{{ aSurveyInfo.class.navbarbrand }} logo-container hidden-xs"  {{ aSurveyInfo.attr.navbarbrand }}  >
    {% if( aSurveyInfo.surveyls_language == "en") %}
      {{ image('./files/logo_en.png', 'English logo', {"class": "logo-en"}) }}
    {% elseif( aSurveyInfo.surveyls_language == "fr") %}
      {{ image('./files/logo_fr.png', 'French logo', {"class": "logo-fr"}) }}
    {% else %}
      {{ image('./files/logo_default.png', 'Default logo', {"class": "logo-default"}) }}
    {% endif %}
  </div>
 
{% else %}
  <div class="{{ aSurveyInfo.class.navbarbrand }}"  {{ aSurveyInfo.attr.navbarbrand }} >
    {{ aSurveyInfo.name }}
  </div>
{% endif %}


This code works well for me most of the time (on the normal survey pages), but not during the registration form or enter-token form (and maybe more of these special forms?).

Does anyone have the same problems? Fixes, work-arounds, ideas? Many thx. Regards. S.

I'm using the hosted LimeSurvey Pro version (at least 3.15) on LS servers, AND also the locally installed xampp version as well (at least 3.15).
Last edit: 6 years 9 months ago by rikatechdoku.
The topic has been locked.
More
6 years 9 months ago - 6 years 9 months ago #177389 by tpartner
What version are you using? [strike]It does work for me in version 3.15.5.[/strike]

[EDIT] After further testing, there is a bug - bugs.limesurvey.org/view.php?id=14282 [/EDIT]

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 6 years 9 months ago by tpartner.
The topic has been locked.
More
6 years 9 months ago - 6 years 9 months ago #177407 by rikatechdoku
Thx, Tony, for testing and opening the ticket. Thx to all who worked on it.

Will the next version be updated for the pro version automatically or must I initiate the update manually?
Because the bug ticket says "fixed" but it is still not working with my current pro version (3.15.5).

I'm using the hosted LimeSurvey Pro version (at least 3.15) on LS servers, AND also the locally installed xampp version as well (at least 3.15).
Last edit: 6 years 9 months ago by rikatechdoku.
The topic has been locked.
More
6 years 9 months ago - 6 years 9 months ago #177411 by holch
As you can see, the fix has been committed to GIT yesterday. So of course it is not yet in the current version. It will be in the next update at the earliest.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
Last edit: 6 years 9 months ago by holch.
The topic has been locked.
More
6 years 9 months ago #177412 by rikatechdoku
Update:
Thx Tony and Denis,
I am now using aSurveyInfo.languagecode instead of aSurveyInfo.surveyls_language.
Seems to work ok. Is there a danger about that which I should be aware of?
Thx & regards, S.

I'm using the hosted LimeSurvey Pro version (at least 3.15) on LS servers, AND also the locally installed xampp version as well (at least 3.15).
The following user(s) said Thank You: DenisChenu
The topic has been locked.
More
6 years 9 months ago #177413 by rikatechdoku
Thx holch,
Do u have any experience of how long that might take for the next update to be released (also on Pro)?

I'm using the hosted LimeSurvey Pro version (at least 3.15) on LS servers, AND also the locally installed xampp version as well (at least 3.15).
The topic has been locked.
More
6 years 9 months ago #177414 by holch
This very much depends. At the beginning of a new branch, when quite a few bugs are fixed, this takes often just a couple of days, but when it is getting closer to the end of a branch this can take quite a while.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose