- Posts: 31
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How to change the order surveys shown on homepage
- batpurev
- Topic Author
- Offline
- Junior Member
Less
More
3 years 2 weeks ago #214646
by batpurev
How to change the order surveys shown on homepage was created by batpurev
Hi all,
Does anyone know how to change the order surveys shown on the homepage? Did some search but could not find similar question.
thanks,
Does anyone know how to change the order surveys shown on the homepage? Did some search but could not find similar question.
thanks,
The topic has been locked.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12937
- Thank you received: 3979
3 years 2 weeks ago #214649
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to change the order surveys shown on homepage
What do you mean by "homepage"
The "survey list" page?
Here you click the headers.
Or the page of public surveys?
Joffm
The "survey list" page?
Here you click the headers.
Or the page of public surveys?
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- batpurev
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 31
- Thank you received: 1
3 years 2 weeks ago #214650
by batpurev
Replied by batpurev on topic How to change the order surveys shown on homepage
Yes surveys listed publicly. I want to re-order, right now it seems like it is listing by its creation date.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
3 years 2 weeks ago #214653
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 How to change the order surveys shown on homepage
I assume that you want to sort them alphabetically.
There may be a way to sort the array via Twig but I have a JavaScript solution...
1) Extend your default survey theme.
2) Make sure that this new theme is assigned as the "Default theme in the global settings.
3) Add this to the end of layout_survey_list.twig:
There may be a way to sort the array via Twig but I have a JavaScript solution...
1) Extend your default survey theme.
2) Make sure that this new theme is assigned as the "Default theme in the global settings.
3) Add this to the end of layout_survey_list.twig:
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Create an array of survey titles var surveyTitles = []; $('.surveys-list a.surveytitle').each(function(i) { $(this).attr('data-sid', $(this).attr('href').split('index.php/')[1].split('?')[0]); surveyTitles.push($.trim($(this).text())); }); // Sort the titles surveyTitles.sort(); // Insert the survey links in sorted order $(surveyTitles).each(function(i, val) { var thisLink = $('a.surveytitle').filter(function(e) { return $.trim($(this).text()) == val; }); $('.surveys-list').append(thisLink.closest('li')); }); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- batpurev
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 31
- Thank you received: 1
3 years 2 weeks ago #214738
by batpurev
Replied by batpurev on topic How to change the order surveys shown on homepage
this did exactly what I needed. thank you so much
The topic has been locked.
- batpurev
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 31
- Thank you received: 1
3 years 6 hours ago #215374
by batpurev
Replied by batpurev on topic How to change the order surveys shown on homepage
hi,
I extended the default theme but how to add custom footer with links in it?
Thanks
I extended the default theme but how to add custom footer with links in it?
Thanks
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
3 years 6 hours ago #215378
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 How to change the order surveys shown on homepage
This is unrelated to this topic. Please start a new topic.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12937
- Thank you received: 3979
3 years 6 hours ago #215379
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to change the order surveys shown on homepage
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.