Support

Home Forums Event Espresso Premium Event-listing: Search box with multiple select-options for categories, staff ..

Event-listing: Search box with multiple select-options for categories, staff ..

Posted: February 20, 2013 at 6:45 am

Viewing 5 reply threads


Frank Grafenstein

February 20, 2013 at 6:45 am

Event-listing: Search box (interface) with multiple select-options for categories, staff, and more ..

I didn’t catch this: does such a search interface exist? I found the only one is via shortcode:
[EVENT_LIST category_identifier=your_category_identifier],
with concateneted identifiers possible.

However, this is not handy for the user-interface.

Another very tiny solution would be [EVENT_SEARCH] – shortcode. Even this does not meet the needs described above.

Do you have a suggestion how to realize a qualified search by event-properties.

Thank you
Frank


Chris Reynolds

  • Support Staff

February 20, 2013 at 11:06 am

Hi Frank —

We don’t have a built in method to search by specific parameters. This may come eventually — maybe around 3.4 or so, when we start pulling in custom post type functionality — but, barring building your own SQL search function, there isn’t a way to do it other than the [EVENT_SEARCH] shortcode.


Frank Grafenstein

February 21, 2013 at 4:36 pm

This is my sql-query, added as a separate function in event-list.php:

// search for categories, having events
$sql = “SELECT DISTINCT c.id, c.category_name, c.category_identifier FROM “.EVENTS_CATEGORY_TABLE.” c “;
$sql .= “JOIN “.EVENTS_CATEGORY_REL_TABLE.” r ON c.id = r.cat_id “;
$sql .= “JOIN “.EVENTS_DETAIL_TABLE.” e ON r.event_id = e.id “;
$sql .= “WHERE is_active = ‘Y’ “;
$sql .= $show_expired == ‘false’ ? ” AND (e.start_date >= ‘” . date(‘Y-m-d’) . “‘ OR e.event_status = ‘O’ OR e.registration_end >= ‘” . date(‘Y-m-d’) . “‘) ” : ”;
$sql .= $show_secondary == ‘false’ ? ” AND e.event_status != ‘S’ ” : ”;
$sql .= $show_deleted == ‘false’ ? ” AND e.event_status != ‘D’ ” : ” AND e.event_status = ‘D’ “;

$categories = $wpdb->get_results( $sql );

Furthermore I use category-identifier field to introduce a certain category-structure using category groups, like ‘groupName-ID’.

Showing multiple category-checkboxes, grouped (by groupName, see above), and carriing out a small JS-function which builds a custom category-identifier-string, I am able to filter events with checked categories out, using shortcode [EVENT-LIST category_idendifier=my-custom-category-identifier-string].

That’s it. Not very tricky, and it works fine.

Frank


Seth Shoultes

  • Support Staff

February 21, 2013 at 10:30 pm

Hi Frank,

Thanks for sharing this! It looks like your code got mangled by our system. Do you mind pasting your code into a Pirate Pad?


Frank Grafenstein

February 23, 2013 at 2:17 am

There nothing has been mangled,
instead of ‘>’,
what html-encodes for ‘>’.

Kind regards
Frank


Seth Shoultes

  • Support Staff

February 24, 2013 at 9:02 pm

Oh okay. Thanks!

Viewing 5 reply threads

The support post ‘Event-listing: Search box with multiple select-options for categories, staff ..’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso