Sorting order category_list

Discuss PivotX 2.0.x here. Non-PivotX related discussions go in The Drain.

Sorting order category_list

Postby Marza » Thu Jul 21, 2011 7:31 am

When you create categories, the info on Sorting order states that categories with the same number will be sorted alphabetically, and that categories with a lower sorting order will be included higher in the list.
However, if category X and Y are excluded from the subweblog Default, they will appear in alphabetical order, but only after the alphabetical list of included categories is displayed.
It would be nice to be able to enforce sorting of all categories by adding order='desc', similar to the modifier of archive_list.
Marza
 
Posts: 85
Joined: Sat Dec 12, 2009 8:49 pm

Re: Sorting order category_list

Postby hansfn » Mon Jul 25, 2011 8:41 pm

I agree that adding sorting parameters to the category_list tag could be useful. If I get time ... I also see that you can get the problem you report. That kind of makes this a bug that we need to fix. Thx for the report. (Harm, feel free to add it to the tracker.)
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Sorting order category_list

Postby Harm10 » Mon Jul 25, 2011 10:04 pm

hansfn wrote:(Harm, feel free to add it to the tracker.)
Will do!

Edit: added!
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2011
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: Sorting order category_list

Postby Marza » Mon Aug 01, 2011 7:12 pm

Thanks.

I just noticed another sorting issue:

If sort_pages_by_alphabet is set to 1, pages in PivotX admin are sorted alphabetically, but not by title but by internal name. I haven't tested whether the same happens in pagelist when the sort parameter isn't specified, but expect it does, since the docs state that the 'default is the PivotX sort as seen in the backend'.

I guess most people would expect sort_pages_by_alphabet to sort by title, but if that's not the case, could a 'set to 2 to sort by title' option be added?
Marza
 
Posts: 85
Joined: Sat Dec 12, 2009 8:49 pm

Re: Sorting order category_list

Postby hansfn » Thu Nov 17, 2011 9:15 am

I looked quickly at this now and this seems to be a bug in the SQL implemention - search after "sort_pages_by_alphabet" in the file modules/pages_sql.php to see the error - "uri" vs "title". (The flat file database does sort by title.) Hopefully fixed before PivotX 2.3.2.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Sorting order category_list

Postby luisamado » Sat Jul 21, 2012 7:19 pm

A method to order categories as you want:

[[category_list only="noticias" format='<li><a href="%url%">%display%</a></li>']]
[[category_list only="eventos" format='<li><a href="%url%">%display%</a></li>']]
[[category_list only="galeria" format='<li><a href="%url%">%display%</a></li>']]
[[category_list only="videos" format='<li><a href="%url%">%display%</a></li>']]

;)
luisamado
 
Posts: 1
Joined: Sat Jul 21, 2012 7:16 pm


Return to 2.x Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron