- Posts: 13
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Language detection in template files
- tacman1123
- Topic Author
- Offline
- LimeSurvey Community Team
Less
More
12 years 2 months ago #73436
by tacman1123
Language detection in template files was created by tacman1123
I want to use a different logo, depending on the language. Is there a way to display a logo conditionally? Something like
<img src="/images/{if(LANGUAGE=='en','en_logo','other_logo')}.png" />
Except I don't think there's a keyword LANGUAGE.
Gracias,
Tac
<img src="/images/{if(LANGUAGE=='en','en_logo','other_logo')}.png" />
Except I don't think there's a keyword LANGUAGE.
Gracias,
Tac
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
12 years 2 months ago #73454
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic Language detection in template files
It might be possible by adjusting this workaround:
docs.limesurvey.org/The+template+editor&...age_specific_element
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
- tacman1123
- Topic Author
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13
- Thank you received: 1
12 years 2 months ago #73472
by tacman1123
Replied by tacman1123 on topic Language detection in template files
Thanks -- what are the better solutions in 1.92? I'm guessing Expression Manager gives us a bit more power. The old way of writing javascript to customize a question never felt right, but the new way is quite elegant.
The topic has been locked.
- TMSWhite
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 44
- Thank you received: 15
12 years 2 months ago #73474
by TMSWhite
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
Replied by TMSWhite on topic Language detection in template files
There is a {LANG} keyword, so you could do this:
or, since you should know all possible languages your survey uses:
Code:
<img src="/images/{if(LANG=='en','en_logo','other_logo')}.png" />
or, since you should know all possible languages your survey uses:
Code:
<img src="/images/{LANG}_logo.png" />
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
- Expression Manager (EM):
Documentation
|
Sample Surveys
|
How Tos
|
Show Logic File
|
Upgrading to 1.92+ - Excel Style for Survey Structure Import/Export
The following user(s) said Thank You: tacman1123
The topic has been locked.
- tacman1123
- Topic Author
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13
- Thank you received: 1
12 years 2 months ago #73478
by tacman1123
Replied by tacman1123 on topic Language detection in template files
Perfect, thanks! Where are the keywords documented? I found the if() syntax while looking at something else, is there more documentation on what the template language can do, like loops or more sophisticated if structures, like Smarty or Twig?
I'm a big fan of both Smarty and Twig, and would be thrilled if LS2.0 consider using them. They're quite fast and have great support.
I'm a big fan of both Smarty and Twig, and would be thrilled if LS2.0 consider using them. They're quite fast and have great support.
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
12 years 2 months ago #73481
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic Language detection in template files
Tom, I couldn't find the {LANG} keyword at one of those lionks:
docs.limesurvey.org/The+template+editor&...+LimeSurvey#Keywords
docs.limesurvey.org/Expression+Manager+H...tions+for+LimeSurvey
docs.limesurvey.org/Expression+Manager+f...tions+for+LimeSurvey
...but I remember you once created a keyword overview. Is this still available and do you think we can place that somewhere else at the manual so that users know which placeholders they can deal with?
@tacman: We are now moving all code to the MVC framework "Yii" for the Limesurvey 2.0 release so such thing is not on the list yet but we hope to lay the basics for it this way.
You can add this as a feature request at our feature tracker . Please describe your idea as detailed as possible and try to outline a suitable solution/implementation as well.
docs.limesurvey.org/The+template+editor&...+LimeSurvey#Keywords
docs.limesurvey.org/Expression+Manager+H...tions+for+LimeSurvey
docs.limesurvey.org/Expression+Manager+f...tions+for+LimeSurvey
...but I remember you once created a keyword overview. Is this still available and do you think we can place that somewhere else at the manual so that users know which placeholders they can deal with?
@tacman: We are now moving all code to the MVC framework "Yii" for the Limesurvey 2.0 release so such thing is not on the list yet but we hope to lay the basics for it this way.
You can add this as a feature request at our feature tracker . Please describe your idea as detailed as possible and try to outline a suitable solution/implementation as well.
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
- TMSWhite
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 44
- Thank you received: 15
12 years 2 months ago #73498
by TMSWhite
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
Replied by TMSWhite on topic Language detection in template files
Here is the
list of keywords
from the last analysis I did. Someone should update the documentation to list any missing ones.
As to documentation about the if() syntax, etc., there is an EM button within 1.92 under survey-specific tools that generates a table of all of the supported functions and their documentation. This table in the main EM documentation should also be up-to-date.
As to documentation about the if() syntax, etc., there is an EM button within 1.92 under survey-specific tools that generates a table of all of the supported functions and their documentation. This table in the main EM documentation should also be up-to-date.
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
- Expression Manager (EM):
Documentation
|
Sample Surveys
|
How Tos
|
Show Logic File
|
Upgrading to 1.92+ - Excel Style for Survey Structure Import/Export
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
12 years 2 months ago #73513
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
Replied by Mazi on topic Language detection in template files
Can we somehow make the list of keywords a little smaller so that it is easier to read and easier to embedd at the documentation?
Maybe separate it into sections (template placeholders, token placeholders, ...)?
Maybe separate it into sections (template placeholders, token placeholders, ...)?
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
9 years 1 month ago #117984
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Language detection in template files
Where is the keyword list now? 90% of the links are lost and the Wiki is just redirecting to main page instead of offering best matches or trying to recreate a temp link. The search isn't helping either.Mazi wrote: Can we somehow make the list of keywords a little smaller so that it is easier to read and easier to embedd at the documentation?
Maybe separate it into sections (template placeholders, token placeholders, ...)?
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
9 years 1 month ago #117985
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Language detection in template files
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
9 years 1 month ago #117989
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Language detection in template files
Thanks, wonder why the search wasn't showing that page.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.