Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#229 2018-01-30 13:05:56

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

Re: stm_article_order: Arbitrary sort order for your articles

The English textpack will need en adding to it, in addition to en-gb and en-us. The default language in 4.7.0 is en so if a pack specifies the language explicitly and this token isn’t in the list, it’ll get missed.

EDIT: actually, perhaps naively, a Textpack can only be in one language. I wonder if we should relax that a bit in core and permit a list of languages like Uli specified. That makes a lot of sense. Let me think it over.

Last edited by Bloke (2018-01-30 13:10:36)


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

#230 2018-01-30 13:15:37

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: stm_article_order: Arbitrary sort order for your articles

#@stm_ao
#@language en (@Bloke)

:)

All (Txp 4.7.0-dev) with 2 edits: #@language en and stm_ao_prefs_menuitem => Article Order >

#@stm_ao
#@language en
stm_ao_article_order => Article Order
stm_ao_article_order_saved => Article order saved.
stm_ao_edit_article => Edit article
stm_ao_edit_image => Edit image
stm_ao_hide_articles => Hide articles
stm_ao_hide_images => Hide images
stm_ao_hints_for_using => Drag an article to a new position and click ”Save”.<br/>By dragging an article to another section you can assign it to that section.<br/>Articles can only be moved one at a time.
stm_ao_it_s_the_one_above => IT'S THE ONE ABOVE!
stm_ao_oops_push_it_please => OOPS! PUSH IT, PLEASE! YOU'LL FIND IT AS THE TOPMOST ARTICLE!
stm_ao_optional_warnings => Should you let an article go beneath the list, scroll the page down to find it.
stm_ao_prefs_h1 => Sections in stm_article_order
stm_ao_prefs_hint => Mark those sections that you don't like displayed in the <a href="index.php?event=stm_article_order">Article Order panel</a>,<br />e.g. those that sort articles by other criteria than manually.
stm_ao_prefs_menuitem => Article Order
stm_ao_prefs_pagetop => Sections in stm_article_order
stm_ao_save => Save
stm_ao_sections_updated => Selection updated
stm_ao_show_articles => Show articles
stm_ao_show_images => Show images
stm_ao_update => Update selection

Last edited by RedFox (2018-01-30 15:20:05)

Offline

#231 2018-01-30 13:16:44

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

Re: stm_article_order: Arbitrary sort order for your articles

Bloke wrote #308969:

[…] a list of languages like Uli specified. […]

I’m too uninspired ;) to even think that and try. That’s the v1.2.1 of ied_pc.

Last edited by uli (2018-01-30 13:17:33)


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

Offline

#232 2018-01-30 13:23:53

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

Re: stm_article_order: Arbitrary sort order for your articles

Stef, if I change the language indicator line of that textpack to …

#@language en, en-us, en-gb

… would that textpack work?

Seems I’ve misinterpreted this here, sorry:

Bloke wrote #308969:

The English textpack will need en adding to it, in addition to en-gb and en-us.

Last edited by uli (2018-01-30 13:33:38)


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

Offline

#233 2018-01-30 13:26:22

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: stm_article_order: Arbitrary sort order for your articles

uli wrote #308972:

Stef, if I change the language indicator line of that textpack to # language en, en-us, en-gb@, would that textpack work? (Had to add spaces in order to overrule forum Textile.)

Tada! … :))

Last edited by RedFox (2018-01-30 13:30:46)

Offline

#234 2018-01-30 13:27:40

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

Re: stm_article_order: Arbitrary sort order for your articles

Ah, great! Thanks, Joop! Looked like you copied my line over. :(

Last edited by uli (2018-01-30 13:29:44)


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

Offline

#235 2018-01-30 13:31:55

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: stm_article_order: Arbitrary sort order for your articles

uli wrote #308975:

Ah, great! Thanks, Joop! Looked like you copied my line over. :(

!!??

Offline

#236 2018-01-30 13:35:05

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

Re: stm_article_order: Arbitrary sort order for your articles

RedFox wrote #308970:

#@language en-en

It should actually be en not en-en. The only reason it worked, btw, was because en-en doesn’t exist so it defaulted to the built-in default, en :-)

uli wrote #308972:

if I change the language indicator line of that textpack to ‘#@language en, en-us, en-gb’ would that textpack work?

I don’t think so. From a cursory check of the code – I may have missed something – languages can only be specified singly (see my edited post above).

We should probably change core to use the first valid one it finds so you could specify, for example:

#@language pt, pt-br

If you have Portuguese installed, you’ll get the pack. If you have pt-br installed, it’ll skip pt and install for pt-br instead. If you have both, well, dunno. It should probably install both but I’m not sure if the pack format is geared up for that. I could try and make it handle it correctly as I think that’d be way better.


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

#237 2018-01-30 13:40:00

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

Re: stm_article_order: Arbitrary sort order for your articles

Thanks for your explanations, Stef. I’ll edit my download post accordingly.

Added: And please think of adapting ied_plugin_composer’s textpack implementation to the solution you’ll choose.

Last edited by uli (2018-01-30 13:46:12)


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

Offline

#238 2018-01-30 14:06:17

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

Re: stm_article_order: Arbitrary sort order for your articles

uli wrote #308978:

please think of adapting ied_plugin_composer’s textpack implementation to the solution you’ll choose.

Plugin Composer’s language handling needs an overhaul in 4.7.0 anyway so I’ll do this as part of the 4.7.0-aware version.


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

#239 2018-01-30 19:10:56

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

Re: stm_article_order: Arbitrary sort order for your articles

I’ve missed the following one:

RedFox wrote #308976:

!!??

I thought we’d have a valid, working solution with the code line in this post.


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

Offline

#240 2021-02-14 09:30:09

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

Re: stm_article_order: Arbitrary sort order for your articles

Hi Uli,

I forked your stm_article_order repo and patched a minor PHP error in the most recent combination of txp 4.8.5 and PHP 7.4 / PHP 8. I also made some other minor updates, like incorporating the textpacks properly, updating help etc. so the plugin should now function properly on recent Textpattern versions.

The updated version is on my GitHub fork and I submitted a pull request to your GitHub repo if you think the changes are worth incorporating.

For those who already have it working nicely on their setup, there’s no new functionality and no pressing need to update unless you encounter a parse_str() error when you update.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB