Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-09-26 20:53:41

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

[request] Search with constraints (custom field is, is not, is in between…)

Textpattern search allows you to search for anything in the title or body. Wet_haystack expands that to whatever you want. However, is it possible to say “show all articles that have a custom field with content that is between 300 and 599”.

I am pretty sure there is something out there (but can’t remember the name) that allows you to limit searches by custom field (if it equals bla), but nothing that allows you say “if the value is between a and b”.

Thought of scripting it with php and smd_query, but maybe there is a better way to do it… (read:easier)

Offline

#2 2009-09-26 21:21:01

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

Re: [request] Search with constraints (custom field is, is not, is in between…)

dl33 wrote:

is it possible to say “show all articles that have a custom field with content that is between 300 and 599”.

Does this smd_if technique help?


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

#3 2009-09-27 00:41:01

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

Re: [request] Search with constraints (custom field is, is not, is in between…)

smd_if does help, however I am afraid that it might be a little inefficient as there will be quite a few entries in that particular section. (Bytheway, this is also a real-estate site.;-)

Pretty sure that smd_query can do the job, just thought it is worth asking whether there is anything else…

Offline

Board footer

Powered by FluxBB