- Posts: 16
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
{# Create an array of the theme names #} {% set aThemes = [] %} {% for oSurvey in aSurveyInfo.publicSurveys %} {% if oSurvey.template not in aThemes %} {% set aThemes = aThemes|merge([oSurvey.template]) %} {% endif %} {% endfor %} {# Loop through the theme names #} {% for theme in aThemes %} {% set themeName = theme %} <h4>{{ themeName }}</h4> <ul class='{{ aSurveyInfo.class.surveylistrowdivbdivul }} list-unstyled ' {{ aSurveyInfo.attr.surveylistrowdivbdivul }}> {% for key, oSurvey in aSurveyInfo.publicSurveys %} {% if oSurvey.template == themeName %} <li class="{{ aSurveyInfo.class.surveylistrowdivbdivulli }} btn-group col-sm-6 col-xs-12" {{ aSurveyInfo.attr.surveylistrowdivbdivulli }}> <a href="{{ oSurvey.sSurveyUrl }}" title="{{ gT("Start survey") }}" lang="{{ oSurvey.language }}" class="{{ aSurveyInfo.class.surveylistrowdivbdivullia }} btn btn-primary col-xs-12" > {{ oSurvey.localizedTitle }} </a> </li> {% endif %} {% endfor %} </ul> {% endfor %}
<h4>Vanilla</h4> <ul class='{{ aSurveyInfo.class.surveylistrowdivbdivul }} list-unstyled ' {{ aSurveyInfo.attr.surveylistrowdivbdivul }}> {% for key, oSurvey in aSurveyInfo.publicSurveys %} {% if oSurvey.template == 'vanilla' %} <li class="{{ aSurveyInfo.class.surveylistrowdivbdivulli }} btn-group col-sm-6 col-xs-12" {{ aSurveyInfo.attr.surveylistrowdivbdivulli }}> <a href="{{ oSurvey.sSurveyUrl }}" title="{{ gT("Start survey") }}" lang="{{ oSurvey.language }}" class="{{ aSurveyInfo.class.surveylistrowdivbdivullia }} btn btn-primary col-xs-12" > {{ oSurvey.localizedTitle }} </a> </li> {% endif %} {% endfor %} </ul> <h4>Other Themes</h4> <ul class='{{ aSurveyInfo.class.surveylistrowdivbdivul }} list-unstyled ' {{ aSurveyInfo.attr.surveylistrowdivbdivul }}> {% for key, oSurvey in aSurveyInfo.publicSurveys %} {% if oSurvey.template != 'vanilla' %} <li class="{{ aSurveyInfo.class.surveylistrowdivbdivulli }} btn-group col-sm-6 col-xs-12" {{ aSurveyInfo.attr.surveylistrowdivbdivulli }}> <a href="{{ oSurvey.sSurveyUrl }}" title="{{ gT("Start survey") }}" lang="{{ oSurvey.language }}" class="{{ aSurveyInfo.class.surveylistrowdivbdivullia }} btn btn-primary col-xs-12" > {{ oSurvey.localizedTitle }} </a> </li> {% endif %} {% endfor %} </ul>
one button redirect to page with vanila theme surveys other button redirect to other theme
{% if oSurvey.template == 'extends_fruity2' %}
{% if oSurvey.template != 'extends_fruity2' %}