All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Searching by Categories and Channel Fields Together

watermelonkid 8 Nov 2018 06:04 question, complete

I'm trying to let the user search by any combination of two category drop-downs and one channel field drop-down.

1) Is this possible? (I think it is.)
2) If it is, I'm not clear on how adding the channel field search changes the form and results code. (With just the two categories, the search works great; but I'm not getting any filtered results from the channel field, "counties" in my example code.

https://pastebin.com/MHUiGNNU

Replies

  1. Low 8 Nov 2018 07:22

    Yes, totally possible.

    For the channel field drop-down, you're targeting a single channel field. In native EE, you'd use search:field_name="value" to filter entries, so in LS, you can use the Field Search filter.

    This means you can use the same parameter name syntax: search:counties. Use that as the name="" attribute in your select element:

    <select name="search:counties">

  2. watermelonkid 8 Nov 2018 19:14

    I was closer than I thought. Thanks, Low!