Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2010-02-19 17:56:45

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: soo_article_filter: additional control over article lists

Version 0.2.4 released. There are two new attributes, index_ignore and index_field. Used in combination, these convert article titles to the form used for alphabetizing indexes, e.g. “The Article Title” becomes “Article Title, The”. This converted title is then stored in a custom field that you can access with the usual Txp tags. Plugin help includes an example.

Edit: Version 0.2.5 released, in response to this.

Last edited by jsoo (2010-02-19 22:14:07)


Code is topiary

Offline

#14 2010-03-08 12:08:32

woof
Member
Registered: 2004-08-01
Posts: 128

Re: soo_article_filter: additional control over article lists

Hi Jeff
Possible future feature suggestion: Is it within the scope of this plugin to filter by status? I suggest it because I recently had the need to output draft articles

Offline

#15 2010-03-08 17:35:33

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: soo_article_filter: additional control over article lists

The plugin could easily be modified to do this, but it wouldn’t help with your issue, because with this plugin you are still using article and article_custom tags to fetch articles.

Edit: However the plugin could change the article status from draft to live or sticky. Could you work with that?

Last edited by jsoo (2010-03-08 17:41:11)


Code is topiary

Offline

#16 2010-03-08 18:16:57

woof
Member
Registered: 2004-08-01
Posts: 128

Re: soo_article_filter: additional control over article lists

Thanks Jeff

jsoo wrote:

The plugin could easily be modified to do this, but it wouldn’t help with your issue, because with this plugin you are still using article and article_custom tags to fetch articles.

*penny drops* Oh yes. Of course – sorry.

However the plugin could change the article status from draft to live or sticky. Could you work with that?

I think so. I’m displaying just one article, the most recent (ie limit=1).
Normally this will show the most recent live article (I’m disregarding sticky status for these purposes)
Now I want to always display the most recent article regardless of whether its status is live or draft so if your plugin wrapping article_custom could achieve this then I think that’s a solution. The only drawback I can see is that its an all-or-nothing scenario — for example it wouldn’t be possible to hide display by setting status to hidden or pending.

Offline

#17 2010-03-08 18:25:59

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: soo_article_filter: additional control over article lists

Yes it would. Haven’t really thought about the user-side implementation of this (i.e., what attributes to provide and how they would work), but e.g. the plugin could change status only for those articles currently “draft” (leaving “hidden” and “pending” untouched). Or some combination of status with category, author, or section.


Code is topiary

Offline

#18 2010-03-08 23:02:16

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: soo_article_filter: additional control over article lists

Version 0.2.6 released. Two new attributes, update_set and update_where, which can be used in tandem to add a custom UPDATE query on soo_article_filter’s temporary `textpattern` table.

Example: change the status of all draft articles in the “News” section to live:

<txp:soo_article_filter update_set="Status=4" update_where="Status=1 AND Section='news'">
<txp:article_custom section="news" />
</txp:soo_article_filter>

Last edited by jsoo (2010-03-08 23:25:22)


Code is topiary

Offline

#19 2010-03-08 23:19:30

PascalL
Member
From: Switzerland
Registered: 2009-03-09
Posts: 132
Website

Re: soo_article_filter: additional control over article lists

Powerful!!!

Thank you!

Offline

#20 2010-03-09 00:29:51

woof
Member
Registered: 2004-08-01
Posts: 128

Re: soo_article_filter: additional control over article lists

works a treat – thank you

Offline

#21 2010-04-03 01:11:01

lazlo
Member
Registered: 2004-02-24
Posts: 105

Re: soo_article_filter: additional control over article lists

Hey Jeff

Can you tell me if your filter can directly implement this:
Sometimes you might want to sort names. If you have First and Last names in one field, seperated by a blank, you can do this by:
SELECT * FROM my_addressbook ORDER BY SUBSTRING_INDEX(custom_1, ‘ ‘, -1) ASC
This works with John Adam, John F. Adam
but not with John F.Adam

It may be handy for others as well who deal with merged data fields.

Hope you can help.

regards
Les Smith

Offline

#22 2010-04-03 01:43:54

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: soo_article_filter: additional control over article lists

<txp:soo_article_filter update_set="custom_2=substring_index(custom_1,' ',-1)">
    <txp:article sort="custom_2 asc" />
</txp:soo_article_filter>

substituting custom_2 with an unused custom field.


Code is topiary

Offline

#23 2010-04-03 01:58:01

lazlo
Member
Registered: 2004-02-24
Posts: 105

Re: soo_article_filter: additional control over article lists

Thanks Jeff.

This is totally useful for all types of calls.
Just to check that new custom_2 field is now permanent, I can call it elsewhere when needed or is it temporary?
Either way this is so rich.

Temporary as the manual says.

regards
Les Smith

Last edited by lazlo (2010-04-03 02:15:16)

Offline

#24 2010-04-03 09:44:33

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

Re: soo_article_filter: additional control over article lists

It may be handy for others as well who deal with merged data fields.

Yes indeed! I have an immediate use for this. Thank you to both of you.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB