- Posts: 1
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
ordering surveys
- reducto
- Topic Author
- Offline
- New Member
Less
More
9 years 1 month ago #117459
by reducto
ordering surveys was created by reducto
hi,
i was just wondering whether i can arrange or re-order the surveys in the homepage. i named the surveys as the following: 1, 2, 3... however, the order is just 2, 3, 1...
is there anyway I can do this without any pain?
i was just wondering whether i can arrange or re-order the surveys in the homepage. i named the surveys as the following: 1, 2, 3... however, the order is just 2, 3, 1...
is there anyway I can do this without any pain?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
9 years 1 month ago #117498
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 ordering surveys
I'm not sure what the thinking was for the list sorting but adding something like this to the end of template.js should sort the list alphabetically.
Code:
$(document).ready(function() { if($('a.surveytitle').length > 0) { var surveyList = $('a.surveytitle:eq(0)').closest('ul'); var titlesArr = []; $('a.surveytitle').each(function(i) { titlesArr.push($.trim($(this).text())); }); titlesArr.sort(); $(titlesArr).each(function(i) { var thisText = this; $('a.surveytitle').filter(function() { return $.trim($(this).text()) == thisText; }).closest('li').appendTo(surveyList); }); } });
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
9 years 1 month ago #117520
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic ordering surveys
Not sure it work, but can try:
<!-- 01 -->B survey
<!-- 02 -->A survey
<!-- 03 -->A2 survey
For each title : adding an HTML comment
<!-- 01 -->B survey
<!-- 02 -->A survey
<!-- 03 -->A2 survey
For each title : adding an HTML comment
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.