Toggle between templates based on language

More
9 months 2 weeks 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.15 hosted on LS servers, not installed locally.

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

More
2 months 3 weeks ago - 2 months 3 weeks ago #177376 by rikatechdoku

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

{# 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: 2 months 3 weeks ago by rikatechdoku.

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

More
2 months 3 weeks ago - 2 months 3 weeks ago #177389 by tpartner
What version are you using? It does work for me in version 3.15.5.

[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.
Attachments:
Last edit: 2 months 3 weeks ago by tpartner.

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

More
2 months 3 weeks ago - 2 months 3 weeks 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: 2 months 3 weeks ago by rikatechdoku.

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

More
2 months 3 weeks ago - 2 months 3 weeks 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.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Last edit: 2 months 3 weeks ago by holch.

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

More
2 months 3 weeks 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

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

More
2 months 3 weeks 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).

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

More
2 months 3 weeks 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.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

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!