Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-03-20 14:12:44

planeth
Plugin Author
From: Nantes, France
Registered: 2009-03-19
Posts: 195
Website

request for category_list tag doc

category_list follow the same rules as section_list : you can give a specific order.
But for that to work, you need to explicitly set sort = "".

The doc should reflect that.

I can do a PR or whatever works. Just point me the direction ;)

Offline

#2 2019-03-20 14:22:29

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,631
Website

Re: request for category_list tag doc

planeth wrote #317183:

category_list follow the same rules as section_list : you can give a specific order. But for that to work, you need to explicitly set sort = "".

Eek, it’s not supposed to, AFAIK. <txp:section_list> should allow you to specify a sections attribute that should keep its given order unless you override it with a sort attribute. Same for <txp:category_list> and the categories attribute.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2019-03-20 15:53:00

planeth
Plugin Author
From: Nantes, France
Registered: 2009-03-19
Posts: 195
Website

Re: request for category_list tag doc

Well, if you don’t explicitly set sort = "" when using category_list with attribute categories for a given order, Textpattern will default to a sort order by name.

I just checked the 2 definitions in taghandler.php and the sort attribute has a default in category_list

Voila, voila :))

Offline

#4 2019-03-20 16:10:32

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,631
Website

Re: request for category_list tag doc

planeth wrote #317189:

Well, if you don’t explicitly set sort = "" when using category_list with attribute categories for a given order, Textpattern will default to a sort order by name.

Ah yes, you’re correct. I was testing on bleeding edge 4.x-dev where Oleg has patched the problem. Sorry for the confusion.

Maybe we do need a Txp 4.7.4 after all…


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2019-03-20 16:13:21

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,631
Website

Re: request for category_list tag doc

Also makes me wonder if section_list’s sort attribute should be defined the same way:

'sort'         => empty($atts['sections']) ? 'name ASC' : ''

??

EDIT: Hmmm, or maybe not as it’s handled explicitly a little further into the function.

Last edited by Bloke (2019-03-20 16:16:01)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2019-03-20 16:48:50

planeth
Plugin Author
From: Nantes, France
Registered: 2009-03-19
Posts: 195
Website

Re: request for category_list tag doc

Bloke wrote #317190:

Maybe we do need a Txp 4.7.4 after all…

May be :)

Offline

Board footer

Powered by FluxBB