Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2015-01-27 12:18:21

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

Re: Sorting sections(names) by name ... how?

etc wrote #287795:

our security department is untreatable.

Hehe, more like waiting for someone to submit a PDO patch so we can use parameterized queries and retire doSlash() once and for all. No hints :-)


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

#14 2015-01-27 14:05:16

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

Re: Sorting sections(names) by name ... how?

In this case on desktop the desired order is:

a | a | a | b
b | c | c | d
d | d

Ah well, that’s a pretty particular arrangement if you want exactly 3 x a, then 2 x b, then 2 x c, then 3 x d. If you just wanted first the a’s, then the b’s, then the c’s, then the d’s running from left to right, my first code example should have done exactly that (but of course at the cost of extra db queries).

Gave me the idea of a tiny plugin

Cool! Now to think of a tricky situation as an excuse to use it.

Now I (and my client) only has to use one keyword … ‘onHomepage’ or something like that …

You could use glz_custom_fields and make a “show_on_homepage: yes” checkbox custom field in the article and then just add show_on_homepage="yes" to your article_custom attributes. Advantage: no exact wording to remember for the client.

Another option if etc’s new plugin also works in other plugins, would be Stef’s own smd_featured. The advantage of the latter is that you don’t have to go into each individual article to add/remove tickmarks / text snippets. You can do it all from a special featured tab. That might be worth investigating…


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB