9 years ago
3
Topic

Hello,

I have a list & search type with a generic search field which searches different fields. Now I have an external calendar script (in the same database) with date values. Each content entry in Seblod is connected over an calendar_id field with a specific calendar. Now I want to filter the search list (additional) with the calender date (give me all entries from my content which fit the generic search + the calendar has no entry for this day (or better an range of days)). In general I have no problems to work with SQL etc. so it's not the problem to expand the given query from Seblod. My question is:

Do I have to code a new search field which searches the other tables or is it possible to use e.g. the calendar field in Seblod, force the field _not_ to search Seblod entries and write a small plugin where I can append the additional query filter.

Thank you for any ideas and help :)

Best regards.

Edit: Updated the description what i wanna do:

Find all entries which has no calendar entries for a given range of dates (while the dates are in a 3rd party extension table)

Get a VIP membership
9 years ago
2
Level 1

I'm not sure, if I'm on the right way, but at the moment I'm looking into cck_storage fields, but I cannot find a way to join "external" tables and filter for them.

Any hints would be appreciated.

4229 Posts
Kadministrator
9 years ago
1
Level 2

Hi,

you can modify search query by adding new fields to the search form and setting their storages. If this is not enough you can join some other table with this field http://www.seblod.com/products/922

9 years ago
0
Level 3

Hello Klas,

thank you for your answer.

I bought that plugin a few months ago but it didn't work as I needed it. Perhaps an example code shows what I need:

SELECT [here default seblod select], COUNT(c.id) as cal_num FROM seblodtable t1 [...] LEFT JOIN calendartable c ON (t1.calendar_id = c.id AND c.date_from >= $search_value_from AND c.date_to <= $search_value_to) WHERE [seblodstruff] AND cal_num = 0 GROUP BY t1.id

Get a Book for SEBLOD