Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-10-18 00:28:53

frederik
Member
From: Denmark
Registered: 2004-12-08
Posts: 17

How do I control the sort order of a category list?

Hi,
I’d like to sort a category list descendingly instead of ascendingly – is that possible with the txp:category_list tag?

e.g. does the “sort” attribute work with category lists?

/Fred

Offline

#2 2006-10-18 01:49:51

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: How do I control the sort order of a category list?

From textbook:

categories=“comma separated category list” – List of category names which will be included in the list. This also determines the list’s sort order. Default is empty leading to an unrestricted list for all categories ordered by name. [4.0.4]

link

Looks like that may be the only way to specify the order….sucks that it’s longhand.

Offline

#3 2006-10-18 09:42:06

frederik
Member
From: Denmark
Registered: 2004-12-08
Posts: 17

Re: How do I control the sort order of a category list?

Walker wrote:

From textbook:
categories=“comma separated category list” – List of category names which will be included in the list. This also determines the list’s sort order. Default is empty leading to an unrestricted list for all categories ordered by name. [4.0.4]

That could work, the only problem is, that there are several authors creating new categories, and it’s quite circumstantial to rewrite the category list tag every time a new category has been added. Maybe the only solution is a plugin!

/Fred

Offline

#4 2006-10-18 12:44:24

frederik
Member
From: Denmark
Registered: 2004-12-08
Posts: 17

Re: How do I control the sort order of a category list?

If anybody is interested I’ve solved my problems of controlling the sort order of a category list by using the article_custom tag:

Tag:

<txp:article_custom limit="999" form="categories" section="articles" sort="Category1 desc" />

Form:

<txp:if_different>
<txp:category1 link="y" title="1" this_section="1" wraptag="li" />
</txp:if_different>

It would have been a lot easier if the sort attribute could be used with the category list tag though!

/Fred

Offline

Board footer

Powered by FluxBB