Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2013-10-07 21:44:41

floodfish
Member
From: Brooklyn, NY
Registered: 2007-01-11
Posts: 155
Website

Re: esq_sectionsort - Custom sorting of sections

Thanks so much for the categories update! I just had a client request sortable categories, so really lucky timing for me.

Offline

#32 2013-10-10 06:05:32

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

Re: esq_sectionsort - Custom sorting of sections

Glad it could help!

Offline

#33 2013-11-11 16:36:49

jagorny
Member
From: Portland, OR
Registered: 2006-08-24
Posts: 39
Website

Re: esq_sectionsort - Custom sorting of sections

It appears that on the front-end, category sorting is sorting on the categorysort field as text and not as int.

For example,

1
10
11
12
13
14
2
3
4

This is on TXP 4.5.5

On the backend the categories and subcategories appear normally in the list.

EDIT** It’s the VARCHAR declaration in establishing both sectionsort and categorysort columns… Switching them to SMALLINT resolves the sort issue for categories – probably sections as well.

You would not see the impact of the sorting problem with less than 10 sections or categories/subcategories.

Last edited by jagorny (2013-11-11 16:49:08)

Offline

#34 2013-11-11 22:51:41

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

Re: esq_sectionsort - Custom sorting of sections

Hi Jacob,

Good catch.

The sort fields were set as VARCHAR back when it wasn’t drag and drop – i.e. users could enter their own sort values (alphabetic, numeric, whatever).

I’ve put out an update for this plugin that alters the sort fields to SMALLINT, while keeping your existing sort settings in tact.

Thanks for the bug report.

Last edited by radneck (2013-11-12 04:34:53)

Offline

#35 2014-12-02 15:45:03

anteante
New Member
Registered: 2012-04-11
Posts: 9

Re: esq_sectionsort - Custom sorting of sections

Thanks a lot for this plugin, very helpful!

I have one minor issue here (running on Textpattern 4.5.7): Sorting works as expected, but when I come back the section-tab in Textpattern, the sorting order has changed again; seems that it falls back “sections by creation date ascending”.

I could be wrong about the sorting criteria here, but it’s def not sort=“sectionsort”.

As said, this does not affect the sort order on the front end, but it’s somewhat irritating for clients.

Any chance to have the sections in the backend displays in regard to sort=“sectionsort”?

Offline

#36 2014-12-03 00:59:56

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

Re: esq_sectionsort - Custom sorting of sections

Hi anteante,

They should stay sorted.

I just downloaded a fresh copy of TXP, added a few sections and installed this plugin.
After moving sections around I went to another admin page, then back to the Sections page again, and everything was in the correct order.

  • Are you using the default admin theme?
  • Can you check in the txp_section table that the sectionsort column is being filled correctly.
  • How many sections do you have?
  • Is there any other plugins that could be conflicting?
  • Are there any errors showing in the console?

Offline

#37 2014-12-03 11:12:14

anteante
New Member
Registered: 2012-04-11
Posts: 9

Re: esq_sectionsort - Custom sorting of sections

Thanks for the fast reply cain-mi,

I am using the default (classic) admin theme, and the sectionsort in txp_section is shown filled out correctly. The only two other plugins I have running are bot_image_upload and rss_admin_db_manager – temporarily disabling them did not help.

After you’ve mentioned the number of sections (I’m currently using 14), I reckon it’s the VARCHAR/SMALLINT issue Jacob was mentioning in this thread earlier on, so section sort in the backend is being displayed

1
10
11
12
13
14
2
3
4

I did read this before, and made sure to install the updated version following your link (2.01). MySQL shows tinyint(4) for the sectionsort field, but the problem seems to persist in the backend.

Last edited by anteante (2014-12-03 11:22:34)

Offline

#38 2014-12-03 12:41:19

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

Re: esq_sectionsort - Custom sorting of sections

Hi anteante,

It does possibly have to do with that issue.

What type is the sectionsort column?
Also what version of PHP are you running?

I think I know what the issue is.
I’ll work on a fix and get back shortly.

Offline

#39 2014-12-03 13:17:21

anteante
New Member
Registered: 2012-04-11
Posts: 9

Re: esq_sectionsort - Custom sorting of sections

The sectionsort column in my DB reads tinyint(4) as type.
Running on PHP Version 5.5.18 and MySQL v5.6.21

Offline

#40 2014-12-04 04:10:15

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

Re: esq_sectionsort - Custom sorting of sections

Hi anteante,

I’ve put out an update for this plugin that properly handles the sort order numerically on admin client side.

This was related to Jacob’s issue, which was fixed only on the front-end it seems.

Update to the latest version and let me know how you go.

Offline

#41 2014-12-04 08:09:53

anteante
New Member
Registered: 2012-04-11
Posts: 9

Re: esq_sectionsort - Custom sorting of sections

Thanks so much for the super-fast fix cain-mi, you’re a legend!

I just updated to v2.02 on two TXP installations, and it works like a charm …

Offline

#42 2014-12-04 08:11:36

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

Re: esq_sectionsort - Custom sorting of sections

Glad I could help :)

Offline

#43 2015-01-23 20:12:16

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

Re: esq_sectionsort - Custom sorting of sections

cain-mi, The site with the compiled plugin code for esq_sectionsort is down right now. Not sure if it’s just a temporary thing, but wanted to let you know. http://popularsizzle.com.au/txp_plugins/esq_sectionsort

Offline

#44 2015-01-23 21:48:01

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

Re: esq_sectionsort - Custom sorting of sections

Hi photonomad,

Thanks for letting me know. Looks like Apache has been down for the last 5 hours.

Should be back up and running now.
For future reference, you can google the URL and pull it down from Google Cache if the site is down.

Cheers :)

Offline

#45 2015-01-23 22:29:01

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

Re: esq_sectionsort - Custom sorting of sections

Thanks! :)

Offline

Board footer

Powered by FluxBB