Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Specify article_custom limit AND check for non-empty custom field?
LIKE and the “%” and “_” characters are standard SQL, but not always consistently implemented. Also, the assumption that the semantics of a tag attribute are equal to the semantics of SQL is not necessarily a good one. It can make for fragile code. Tags serve as an intermediary between you and the storage engine (database) for a reason. Pierce that veil at your own risk. ;)
Offline
Re: Specify article_custom limit AND check for non-empty custom field?
There’s also sort. Used to be split into sortby
and sortdir
attributes; now we’re expected to put valid ORDER BY
expressions into sort
. Having separate attributes is, I think, closer to your idea of tags as intermediary. Which I agree with, but I also agree with keeping the number of attributes in check. Something’s gotta give.
And there’s smd_query. Probably lots of MySQL-specific Txp code out there now. Again, I’m not saying this is good in itself, but by gum it works. Undoubtedly some of us will have some extra work, some day, prepping an existing site for conversion to a different DB engine. But probably not much. The smd_where_used plugin will be a handy helper for that task…
Code is topiary
Offline
Re: Specify article_custom limit AND check for non-empty custom field?
jsoo wrote:
There’s also sort. Used to be split into
sortby
andsortdir
attributes; now we’re expected to put validORDER BY
expressions intosort
.
Yeah, there do seem to be a few instances where database dependency has crept into core. Not a good thing IMHO.
And there’s smd_query. Probably lots of MySQL-specific Txp code out there now.
Sure, but that’s a plugin, and plugins are by definition a compatibility risk. I’m more concerned with the core and being able to move it forward effectively without breaking existing sites.
Offline
Re: Specify article_custom limit AND check for non-empty custom field?
artagesw wrote:
Yeah, there do seem to be a few instances where database dependency has crept into core. Not a good thing IMHO.
Oh, yeah, conditionals or a parser for the values, which IMHO makes it more limited and slower.
artagesw wrote:
plugins are by definition a compatibility risk.
Lol’d.
Offline
Re: Specify article_custom limit AND check for non-empty custom field?
Gocom wrote:
Oh, yeah, conditionals or a parser for the values, which IMHO makes it more limited and slower.
By that argument, you might as well throw away the entire Textpattern tagging system and write straight PHP for your templates. Compared with PHP, Textpattern tags are slow (require an additional layer of parsing) and limited. But there are benefits to tags that outweigh these costs, so we trade off some performance and flexibility to gain these benefits.
artagesw wrote:
plugins are by definition a compatibility risk.
Gocom wrote:
Lol’d.
It’s true. Plugins are essential, yes. But when you decide to use them, you must be prepared for potential problems down the road. From Textbook:
When a webmaster uses a plugin to achieve a goal on its website, if that goal is “critical” then he should seriously think it through. Because if:
- a new Textpattern version breaks the plugin
- the plugin is not maintained anymore
- a security flaw is discovered with it
and the plugin author does not (or can’t) fix it, the site may not function as you intend.
Offline
Re: Specify article_custom limit AND check for non-empty custom field?
artagesw wrote:
gain these benefits.
But we need to weight the benefits. And IMHO, I wouldn’t put that little sort value in the category of benefits. Also it will disable MySQL version destricted hacks, that for examle right now make some websites work. For example sorting of varchar fields as ints.
artagesw wrote:
It’s true. Plugins are essential, yes. But when you decide to use them, you must be prepared for potential problems down the road.
I just lol’d for your definition, chill out :). I know that, or then I’m been on drugs donuts for the last five years. Donuts…
Offline
#31 2009-07-06 14:58:11
- alannie
- Member
- From: Minnesota, USA
- Registered: 2005-09-15
- Posts: 150
Re: Specify article_custom limit AND check for non-empty custom field?
By Jove! video_id="_%"
works. jsoo, do you have any kind of blog or email notification list that I can join to be notified of your future brilliant discoveries and plugins? :)
By the way, I wouldn’t mothball your plugin just yet … I bet it could come in handy for other uses. I’ll let you know if I come across any examples beyond the ones you already have listed.
Last edited by alannie (2009-07-06 14:59:36)
Offline
Re: Specify article_custom limit AND check for non-empty custom field?
alannie wrote:
By Jove!
video_id="_%"
works. jsoo, do you have any kind of blog or email notification list that I can join to be notified of your future brilliant discoveries and plugins? :)
My Txp brilliancy ;) shines forth rather sporadically, intermixed with a much higher percentage of blather, on this forum; very irregularly on my own Txp page, to which, for various reasons, I have not yet added a feed. I just posted a tip on Txp Tips, which does have a feed, well worth following. Might post this one as another Txp Tip, pace artagesw.
By the way, I wouldn’t mothball your plugin just yet … I bet it could come in handy for other uses. I’ll let you know if I come across any examples beyond the ones you already have listed.
Well, picked up one user pretty quickly, so I’ll keep it online for now.
Code is topiary
Offline