Welcome to the LimeSurvey Community Forum

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

Survey list in home page

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 3 weeks ago #196170 by tpartner
Replied by tpartner on topic Survey list in home page

And furthermore you could try some javascript functions like
str.indexOf("extended") to get all templates that contain "extended" in their name.

Creating the separate lists with JavaScript would be a different (but viable) approach than the pure TWIG solution outlined above.

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
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 3 weeks ago - 4 years 3 weeks ago #196173 by Joffm
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

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
  • Andrewsss's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
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.

Lime-years ahead

Online-surveys for every purse and purpose