Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
SQL attribute for article_custom
I keep running into this problem:
- I want an article which has no categories, or
- I want an article which doesn’t have some value in a custom field, etc..
The problem with article / article_custom is the attributes are only additive (I don’t know if that’s the correct term) – textpattern will select every article, which you can filter down by adding conditions. But very often I want subtractive conditions: category != 'tal'
or custom_field NOT LIKE 'fulano'
. Since that would make attribute syntax very confusing, what about just adding a raw SQL attribute:
<txp:article_custom section="tal" category="fulano" sql="custom_1 NOT LIKE 'foo%'" />
What do you think?
Last edited by rloaderro (2008-04-03 16:04:45)
Travel Atlas * Org | Start Somewhere
Offline
#2 2008-04-03 16:26:32
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: SQL attribute for article_custom
rloaderro,
Probably you already know but a similar question was discussed here
Offline
Re: SQL attribute for article_custom
Actually I didn’t! I looked through the recent threads and didn’t see anything so I posted this – guess I didn’t look hard enough!
It’s funny cause my first impulse was to suggest an OR – but then thought an SQL attribute would solve that and not have to be so complex – while offering more flexibility at the same time. Maybe… 4.0.7? ;)
Travel Atlas * Org | Start Somewhere
Offline
#4 2008-04-05 16:01:55
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: SQL attribute for article_custom
rloaderro wrote:
It’s funny cause my first impulse was to suggest an OR – but then thought an SQL attribute would solve that and not have to be so complex – while offering more flexibility at the same time. Maybe… 4.0.7? ;)
Ok so I guess my suggestion was not so useful as you have already debated with yourself and came to the same conclusion ;)
Offline
#5 2008-06-04 16:00:10
- alice_c
- Plugin Author
- From: Karlsruhe, Germany
- Registered: 2004-07-03
- Posts: 33
Re: SQL attribute for article_custom
I wrote an answer to this in the other thread:
http://forum.textpattern.com/viewtopic.php?pid=181145#p181145
Hopefully this gets in the source, soon :)
Offline
Re: SQL attribute for article_custom
Have you seen smd_query?
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline