- Posts: 55
- Thank you received: 3
Ask the community, share ideas, and connect with other LimeSurvey users!
<div> {# TODO: move back this logic to SurveyRuntime, and provide a ready to use indexItem.statusClass #} {% for step, indexItem in aSurveyInfo.aQuestionIndex.items %} {% set statusClass = '' %} {% if attribute(indexItem.stepStatus, 'index-item-unanswered') is defined and attribute(indexItem.stepStatus, 'index-item-unanswered') == true %} {% set statusClass = statusClass ~ ' index-warning' %} {% endif %} {% if attribute(indexItem.stepStatus, 'index-item-error') is defined and attribute(indexItem.stepStatus, 'index-item-error') == true %} {% set statusClass = statusClass ~ ' index-danger' %} {% endif %} {% if attribute(indexItem.stepStatus, 'index-item-current') is defined and attribute(indexItem.stepStatus, 'index-item-current') == true %} {% set statusClass = statusClass ~ ' disabled' %} {% endif %} <li class="list-group-item {{ indexItem.coreClass }}"> <a href='{{ indexItem.url }}' data-limesurvey-submit='{{ indexItem.submit }}' class='dropdown-item {{ statusClass }}'> {{ indexItem.text }} </a> </li> {% endfor %} </div>
{% if indexItem.showItem == 1 %} {#other code here#} {% endif %}
Please Log in to join the conversation.
Please Log in to join the conversation.
&zwnj
Please Log in to join the conversation.
Please Log in to join the conversation.
{% for step, indexItem in aSurveyInfo.aQuestionIndex.items %} {% if '#' in indexItem.text %} {% set statusClass = '' %} {% if attribute(indexItem.stepStatus, 'index-item-unanswered') is defined and attribute(indexItem.stepStatus, 'index-item-unanswered') == true %} {% set statusClass = statusClass ~ ' index-warning' %} {% endif %} {% if attribute(indexItem.stepStatus, 'index-item-error') is defined and attribute(indexItem.stepStatus, 'index-item-error') == true %} {% set statusClass = statusClass ~ ' index-danger' %} {% endif %} {% if attribute(indexItem.stepStatus, 'index-item-current') is defined and attribute(indexItem.stepStatus, 'index-item-current') == true %} {% set statusClass = statusClass ~ ' disabled' %} {% endif %} <li class="list-group-item {{ indexItem.coreClass }}"> <a href='{{ indexItem.url }}' data-limesurvey-submit='{{ indexItem.submit }}' class='dropdown-item {{ statusClass }}'> {{ indexItem.text|split('#')[0] }} </a> </li> {% endif %} {% endfor %}
Please Log in to join the conversation.
{% if '#' in indexItem.text %}
Please Log in to join the conversation.
Yes, if you are after a binary attribute, this is a great way to handle it.I've solved it by just adding a "#" (the character(s) are arbitrary. You can just choose whatever) at the end of the question group title.
Please Log in to join the conversation.
{% if attribute(indexItem.stepStatus, 'index-item-unanswered') is defined and attribute(indexItem.stepStatus, 'index-item-unanswered') == true %}
Please Log in to join the conversation.