Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2022-04-27 14:16:34

Erni
New Member
Registered: 2022-04-27
Posts: 4

Custom sorting/order by category

Hi,

I would like to create my own sort of categories (at a specific level).

Example in category tree:
  • A
  • B
    • A
    • B
    • C
    • Y
    • Z
  • C
I want to get in menu on website:
  • C
  • B
    • C
    • A
    • Z
    • B
    • Y
  • A

How I can do it? In database i can’t saw column `position` or `order`.

Offline

#2 2022-04-27 14:22:20

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: Custom sorting/order by category

Hi erni and welcome!

Try the plugin esq_sectionsort. It adds a sectionsort and categorysort column and a corresponding drag-and-drop capability for both sections and categories. You can then sort your output by the “categorysort”.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2022-04-27 14:49:55

Erni
New Member
Registered: 2022-04-27
Posts: 4

Re: Custom sorting/order by category

jakob wrote #333169:

Try the plugin esq_sectionsort.

I try but this plugin not working (in admin panel -> Content -> section Category i can’t saw new options to sorting items).
Database `category` after installation “esq_sectionsort” have new column `categorysort` but options to sorting in Category Tree doesn’t exists.

PS: In “Presentation -> Section” options to sorting is exists.

Offline

#4 2022-04-27 15:22:05

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: Custom sorting/order by category

I found the problem and will update it shortly.


TXP Builders – finely-crafted code, design and txp

Offline

#5 2022-04-27 15:30:09

Erni
New Member
Registered: 2022-04-27
Posts: 4

Re: Custom sorting/order by category

jakob wrote #333171:

I found the problem and will update it shortly.

My version Textpattern CMS (v4.8.8)

Offline

#6 2022-04-27 16:00:58

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: Custom sorting/order by category

Try this version. The incompatibility that arose is with PHP 8 I think. There’s some more streamlining to do but this should work.

[ removed – please see the GitHub Repo ]


TXP Builders – finely-crafted code, design and txp

Offline

#7 2022-04-27 17:50:58

Erni
New Member
Registered: 2022-04-27
Posts: 4

Re: Custom sorting/order by category

jakob wrote #333173:

Try this version. The incompatibility that arose is with PHP 8 I think. There’s some more streamlining to do but this should work.

Thanks for the quick support! Now plugin doing great. Can I enable “debug mode” and check errors from this and other plugins?

Offline

#8 2022-04-27 20:19:54

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: Custom sorting/order by category

Erni wrote #333174:

Thanks for the quick support! Now plugin doing great. Can I enable “debug mode” and check errors from this and other plugins?

Yes. The plugin doesn’t have any front end tags, just the additional sort values for sections and customs.

I’ve cleaned the plugin up a bit and made a few more updates – removed duplicate code, added plugin help, corrected feedback notification formatting. You can find it here: esq_sectionsort v2.0.5.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB