johnsu01 (johnsu01) wrote,
johnsu01
johnsu01

Sorting in the Quills archive portlet

The archives portlet to your left now lists the months in descending order.

Finally got around to fixing the Quills portlet_archives template so that it sorts the months.

The original template has just the first definition in this TALES block. Add the next two definitions, then change the li element to use "sorted_months" instead of "months", and you should be all set.

<ul tal:define="months python:year.getFolderListingFolderContents(suppressHiddenFiles=1);
                sort_on python:(('title','cmp', 'desc'),);
                sorted_months python:sequence.sort(months, sort_on);">
  <li tal:repeat="month sorted_months">

I basically copied this from the API reference for the sequence module. Took me a while to find that, though, so I'm putting it here for safe keeping and easy access.

Next up will be sorting the topics list alphabetically.

Tags: plone, quills, tales, website, zope, zpt
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments