Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-04-17 10:33:00

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

section list sort order

I’m looking at the docs regarding the sort="" attribute for section list, and the value options don’t make any sense to me as written. I’ve tried a couple guesses, but I don’t get a order I need. So I’m wondering…

  1. Maybe someone can put a parenthetical note after each attribute option and explain what the sort behavior is supposed to be when using it.
  2. Is it possible to have a custom_order attribute where you can list the order you want by section name? For example…

<section::list custom_order="default, pears, bananas, kiwis, etc"> ...

Offline

#2 2018-04-17 10:40:10

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: section list sort order

Never mind, just realized I can do that with regular HTML. ;)

Offline

#3 2018-04-17 10:46:44

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: section list sort order

lol

sections="section name(s)" (displays in specified order)

I need to read better.

Still goes for the notes on the sort attribute options, though. ;)

Offline

#4 2018-04-17 10:57:56

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: section list sort order

I’ve added a few notes in parentheses. Some of the sort options really are quite pointless though.


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 2018-04-18 09:42:43

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: section list sort order

Bloke wrote #311107:

Some of the sort options really are quite pointless though.

Agreed. Old man Nielsen’s industry monitoring would tell us the order is best made by considering conventions (e.g. ‘home’ first, ‘contact’ last, if you use them) and front-loading the primary content sections (relative to language direction).

Thus, these are the only useful attributes regarding the section list composition, which gives full custom control:

  • include_default="boolean"
  • default_title="text"
  • sections="section name(s)"
  • exclude="section name(s)"

I know I will never use sort="". Only the default by “name” is functionally useful, I guess.

Offline

Board footer

Powered by FluxBB