- Posts: 10109
- Thank you received: 3595
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Survey list in home page
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
4 years 3 weeks ago #196170
by tpartner
If you want to use JavaScript, you will need to place an attribute in the <li> elements so the JS can identify them.
Something like:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Survey list in home page
Creating the separate lists with JavaScript would be a different (but viable) approach than the pure TWIG solution outlined above.And furthermore you could try some javascript functions like
str.indexOf("extended") to get all templates that contain "extended" in their name.
If you want to use JavaScript, you will need to place an attribute in the <li> elements so the JS can identify them.
Something like:
Code:
<li class="{{ aSurveyInfo.class.surveylistrowdivbdivulli }} btn-group col-sm-6 col-xs-12" {{ aSurveyInfo.attr.surveylistrowdivbdivulli }} data-theme="{{ oSurvey.template }}">
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: Andrewsss
The topic has been locked.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12941
- Thank you received: 3979
4 years 3 weeks ago - 4 years 3 weeks ago #196173
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Survey list in home page
Sorry,
I was confused a bit.
In that moment I did not realize that it is twig, not javascript.
So I think you can use:
{% if 'extend' in oSurvey.template %} resp. {% if 'extend' not in oSurvey.template %}
Joffm
I was confused a bit.
In that moment I did not realize that it is twig, not javascript.
So I think you can use:
{% if 'extend' in oSurvey.template %} resp. {% if 'extend' not in oSurvey.template %}
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 3 weeks ago by Joffm.
The topic has been locked.
- Andrewsss
- Topic Author
- Offline
- New Member
Less
More
- Posts: 16
- Thank you received: 0
4 years 3 weeks ago #196179
by Andrewsss
Replied by Andrewsss on topic Survey list in home page
Thanks for the help, you helped a lot.
The topic has been locked.