Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-12-18 13:00:56

ibob
Member
From: Finland
Registered: 2010-06-14
Posts: 35

Order field behind categories

It would be absolutely great if you could alter table txp_categories to have “order” input field behing categories (Article, Link, Image and File categories) and add this field behind category tabs + possiblity to use this new field in category_list sort attribute value with asc/desc option. If possible i’d prefer field values as int than string where 1 is listed at first, 2 second etc. and that empty fields (unsorted) are left last in list.

Sorting could work like this:

Category A (Order value 1.)
    Category A.2 (Order value 1.)
    Category A.1 (Order value 2.)
    Category A.3 (Order value 3.)
Category B (Order value 2.)
    Category B.3 (Order value 1.)
    Category B.2 (Order value 2.)
    Category B.1 (Order value 3.)
    Category B.4 (Order value "empty")
Category C (Order value 3.)
    Category B.2 (Order value 2.)
    Category B.1 (Order value 3.)

More about issue and why this is needed at http://forum.textpattern.com/35135

I think this is something that I’ve seen many asking and I would give a fee for this feature.

Last edited by ibob (2010-12-18 17:38:52)

Offline

#2 2010-12-18 13:24:42

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Order field behind categories

+1, but with alphabetical sorting, similar to what’s done for links. Alphabetical sorting has the advantage that you can insert 15 between 1 and 2 (sort order: 1,15,2). If done numerically, you’d have to first change 2 to 3 and then add 2 (sort order 1,2,3), which is a lot of work if you have a long category list.

Offline

#3 2010-12-18 17:33:53

ibob
Member
From: Finland
Registered: 2010-06-14
Posts: 35

Re: Order field behind categories

ruud wrote:

Alphabetical sorting has the advantage that you can insert 15 between 1 and 2 (sort order: 1,15,2). If done numerically, you’d have to first change 2 to 3 and then add 2 (sort order 1,2,3), which is a lot of work if you have a long category list.

Now after you explained alphabetical sorting vs numeric I agree 100% with you. Alphabetical would be much better, numeric would require some drag&drop features to category lists otherwise there would be massive usability issues.

Offline

#4 2010-12-18 18:20:29

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: Order field behind categories

[Wait and see what cain-mi has in the pipeline? Already mentioned by Els somewhere Els ;)

Last edited by uli (2010-12-18 18:23:43)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#5 2010-12-19 05:44:00

radneck
Plugin Author
Registered: 2005-07-03
Posts: 109

Re: Order field behind categories

uli wrote:

A new version will be out in a few of weeks. Until then, I’ve sent ibob a beta version that Jakob whipped up.

Last edited by radneck (2015-11-04 07:41:33)

Offline

#6 2010-12-19 22:34:54

ibob
Member
From: Finland
Registered: 2010-06-14
Posts: 35

Re: Order field behind categories

Thank you Jakob and Mitch! Plugin is awesome, actually bit scary ‘cos it seems to be exactly what I described above. Really nice coincident!

Offline

#7 2011-02-17 18:22:30

nabrown78
Member
From: Northampton, MA, USA
Registered: 2006-10-04
Posts: 294
Website

Re: Order field behind categories

+1 Wow, yes! The ability to tailor Categories sort order would be brilliant. Till then I’ll check out the plugin!

Offline

#8 2012-09-19 05:27:49

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,092
Website Mastodon

Re: Order field behind categories

nabrown78 wrote:

+1 Wow, yes! The ability to tailor Categories sort order would be brilliant. Till then I’ll check out the plugin!

any updates on the plug in??


…. texted postive

Offline

#9 2012-09-20 00:09:51

radneck
Plugin Author
Registered: 2005-07-03
Posts: 109

Re: Order field behind categories

bici wrote:

any updates on the plug in??

See here.

Last edited by radneck (2013-10-10 04:34:54)

Offline

#10 2013-10-10 21:44:39

JimJoe
Member
From: United States
Registered: 2010-01-30
Posts: 573
Website

Re: Order field behind categories

Many thanks !

Offline

#11 2013-10-10 21:49:04

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 2,092
Website Mastodon

Re: Order field behind categories

cain-mi wrote:

bici wrote:
any updates on the plug in??

See here.

thanks. Sorry to hear that you are moving on, but glad that you’ll keep woking on the plugin to squash bugs.


…. texted postive

Offline

#12 2013-10-11 11:29:18

etc
Developer
Registered: 2010-11-11
Posts: 5,195
Website GitHub

Re: Order field behind categories

Not to remove any merit from the plugin, but you don’t need it for casual modifications:

<txp:php>safe_query("SET @cat1='b', @cat2='d', @cat3='a', @cat4='c'");</txp:php>
<txp:category_list sort="FIELD(name, @cat1, @cat2, @cat3, @cat4)" />

will output the categories in the b,d,a,c order. You could even call simply

<txp:category_list sort="FIELD(name, 'b', 'd', 'a', 'c')" />

if there were no pesky $sort = doSlash($sort); in category_list() function (may some brave dev drop it).

Offline

Board footer

Powered by FluxBB