Sorting Archive By Most Recent Date

Permalink Browser Info Environment
I have an Archive on my site, which works fine but I want current items (2014) at the top and older years below. I have tried all the sort options in the block, but nothing changes.

Is there an easy way in code I can flip the order around?

thanks - Tim

Type: Discussion
Status: In Progress
fieldsyncmobile
View Replies:
jpgriffin replied on at Permalink Reply
jpgriffin
I'm looking for this as well. . . . may have to get my php books out.
BHWW replied on at Permalink Reply
BHWW
Hi I haven't been able to find a way to do this by adjusting the code, however I have done it with a quick bit of jquery. I added the following to the view.js in the /blocks/problog_list/templates/archive/ folder (obviously put it where it should be in a copy in the root):

$(document).ready(function(){
   $('#sidebar-archives h4').click(function(){
      $('.archived_list').slideUp();
      $(this).next('.archived_list').slideDown();
   });
   $('h4+ul').each(function(){
    $(this).prev().andSelf().wrapAll('<div>');
   });
   var years = document.getElementById("sidebar-archives");
   var i = years.childNodes.length;
   while (i--)
      years.appendChild(years.childNodes[i]);
});


Hope this helps someone in the future!

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.