|Sorting in the Quills topic portlet
||[19 Jun 2005|01:46am]
The topics list is now dynamically alphabetized. These things matter to me.
As promised, I made revisions to the Quills topics portlet to alphabetize the
list of topics. Pretty simple again.
Here's the diff in portal_skins/Quills/portlet_topics:
< <ul tal:define="parent python:here.quills_tool.getParentWeblog(here)">
< <tal:loop repeat="topic parent/getAvailableTopics">
> <ul tal:define="parent python:here.quills_tool.getParentWeblog(here);
> topics parent/getAvailableTopics;
> sort_on python:(('title','cmp', 'asc'),);
> sorted_topics python:sequence.sort(topics, sort_on);">
> <tal:loop repeat="topic sorted_topics">
Works for me. Let me know if you see anything wrong with this one, or the
I guess it would also be cool to sort the topics list by the number of entries
in each topic instead, but I think I prefer the alphabetical list.