Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#121 2011-05-29 11:56:02

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

Re: stm_article_order: Arbitrary sort order for your articles

Teemu wrote:

Each language version of an article has a different id, these all are in ‘textpattern’ table.

Teemu, this sufficiently describes what I wanted to know.

Thanks for posting the multiple image code, I’ll integrate it into the next version.
Please be so kind to also post the MLP line you duplicated, so I can link to it from my post #59. Thus we’d have a description (install MLP after stm_article_order) and working code for people using MLP together with stm_ao. Thanks!


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

Offline

#122 2011-05-29 15:41:40

Teemu
Member
From: Shanghai
Registered: 2010-04-27
Posts: 60

Re: stm_article_order: Arbitrary sort order for your articles

uli wrote:

Please be so kind to also post the MLP line you duplicated, so I can link to it from my post #59. Thus we’d have a description (install MLP after stm_article_order) and working code for people using MLP together with stm_ao. Thanks!

As you suggested, I dublicated this line for each language table:

safe_update("textpattern", "position = $position, Section = '$section'", "ID = $ID");

So, for example, English:

safe_update("l10n_lang_gb_en", "position = $position, Section = '$section'", "ID = $ID");

This is a manual solution, a step further would be dynamic call that picks up all the installed language tables.

Last edited by Teemu (2011-05-29 15:42:24)

Offline

#123 2011-06-29 13:55:54

jens31
Plugin Author
From: munich / dtschermani
Registered: 2008-08-25
Posts: 183
Website

Re: stm_article_order: Arbitrary sort order for your articles

Teemu schrieb:

So, for example, English:

safe_update("l10n_lang_gb_en", "position = $position, Section = '$section'", "ID = $ID");

this is wrong. the table is not called l10n_lang_gb_en but l10n_txp_en_gb

so:

safe_update("l10n_txp_en_gb", "position = $position, Section = '$section'", "ID = $ID");

is the correct line.

[Edit]

PLUS
the plug-in stm_ao uses the standard textpattern table to sort the articles in the ao tab.
this means its helpful to keep the textpattern table updated as well.
so dont change the line in the plug-in code but simply add the other languages..!!
(you had that in your description teemu, but hidden somewhere in between the next issue..)

Last edited by jens31 (2013-09-02 16:53:58)

Offline

#124 2011-10-27 07:54:24

rathersplendid
Plugin Author
From: London
Registered: 2008-05-02
Posts: 163
Website

Re: stm_article_order: Arbitrary sort order for your articles

Uli’s updated version (& the original for that matter) do not work for article’s output on the homepage (they do on the section page itself).

I’ll give you my scenario; homepage uses this:

<txp:article wraptag="" break="" class="" sort="position asc" limit="999">
	<article class="<txp:category1 /> ">
		<txp:upm_article_image form="img_archive" limit="1" />
	</article>
</txp:article>

Is there anything that I might be doing wrong?

Last edited by rathersplendid (2011-10-27 07:54:59)


Admin Themes Prometheus | Stung | <txp:coder/
My Portfolio | ɹǝpuɐz.com | @MrMartineau
<txp:coder /> – Convert your designs into Textpattern-based websites
jQuery Style | @jquerystyle

Offline

#125 2011-10-27 10:27:29

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

Re: stm_article_order: Arbitrary sort order for your articles

rathersplendid wrote:

Uli’s updated version (& the original for that matter) do not work for article’s output on the homepage (they do on the section page itself).

Have it working here on the homepage, Zander. Did you make sure your homepage is served by a txp-page with an article tag with sort=position?


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

Offline

#126 2011-10-27 12:44:42

rathersplendid
Plugin Author
From: London
Registered: 2008-05-02
Posts: 163
Website

Re: stm_article_order: Arbitrary sort order for your articles

uli wrote:

Have it working here on the homepage, Zander. Did you make sure your homepage is served by a txp-page with an article tag with sort=position?

As you can see above, I am using sort=position. It is being served by a txp page (how else would I do it???)

Correct me if I’m wrong..


Admin Themes Prometheus | Stung | <txp:coder/
My Portfolio | ɹǝpuɐz.com | @MrMartineau
<txp:coder /> – Convert your designs into Textpattern-based websites
jQuery Style | @jquerystyle

Offline

#127 2012-12-05 11:40:40

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: stm_article_order: Arbitrary sort order for your articles

Hi Uli,

I rewrote the <txp:link_to_next /> and <txp:link_to_prev /> for an usage with the stm_article_order sort="position (asc|desc)".

I thought about publishing it as an additional plugin, but I think this makes no sense. If you could test it and include in the plugin. Would be great.

The introduced <txp:stm_link_to_next /> and <txp:stm_link_to_prev /> working the same way as <txp:link_to_next /> and <txp:link_to_prev /> from the TXP 4.5.3, but support the position sort order and providing a class attribute:

<txp:stm_link_to_prev class="left" /> | <txp:stm_link_to_next class="right" />

Here are the code:

Code removed for inspecting ...

Last edited by trenc (2012-12-14 12:24:58)


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#128 2012-12-05 14:38:21

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

Re: stm_article_order: Arbitrary sort order for your articles

Thanks, Tommy! I always missed these ones.

I’ll merge them in and try in my sandbox as soon as I find enough time. If I’m not mistaken the minimum plugin requirement will then have to be TXP 4.5.3, right?

Last edited by uli (2012-12-05 14:39:57)


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

Offline

#129 2012-12-05 17:08:20

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: stm_article_order: Arbitrary sort order for your articles

If I’m not mistaken the minimum plugin requirement will then have to be TXP 4.5.3, right?

Can’t say that exactly. It’s shipped with a own getNextPrev() but not with an own getNeighbour(), which was rewritten for TXP 4.5.0.
I never testet it against a TXP version before 4.5.3.


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#130 2012-12-14 12:22:38

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: stm_article_order: Arbitrary sort order for your articles

Uli, please wait with the merging.
It seems the code ist not working correctly. I have to inspect this issue first.


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#131 2013-02-17 17:53:00

springworks
Member
Registered: 2005-01-06
Posts: 172
Website

Re: stm_article_order: Arbitrary sort order for your articles

For anyone interested, I have extended this plugin to add the ability to choose which sections appear in the Article Order tab. I have done this before for clients by hard coding the selected sections into a modified version of the plugin, but I thought it would be handy to have a more general customisable version. I often use sections for smaller pieces of content that don’t represent full pages and it can be confusing for clients to see these in the Article Order tab. This adapted plugin allows you to present a much cleaner interface for your clients.

The extended plugin adds a new tab under the Extensions tab enabling you to exclude sections from the Article Order tab. It does this by adding a column to the txp_sections table in the database. Much of the code was borrowed and adapted from adi_menu (thanks Adi!) so I really shouldn’t take any credit for this. Note that due to the use of plugin lifecycle events to create the extra database column when the plugin is enabled (and to delete it again when it is disabled) this version of the plugin requires TXP 4.5 or higher. I have tested it on TXP 4.5.4 and it works. The Extensions > Article Order Sections tab requires Publisher rights to view.

This is the first plugin code that I have released to the public so please excuse my coding and please would anyone with greater knowledge than me (i.e. anyone!) let me know if there are any glaring errors or security issues with the code.

Enjoy ;-)

Download stm_article_order 0.3

Offline

#132 2013-02-18 16:52:48

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: stm_article_order: Arbitrary sort order for your articles

I like the smt_article_order plugin and I am happy that people like uli (smt_article_order 2.4) and you continue to develop it. And I hope that there will be not different branches in the development, but rather a single line of development, so that it will be no longer a orphaned (abandoned) plugin.

Thanks for your work.

Offline

Board footer

Powered by FluxBB