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

Support archive

name="search:custom_field"

Justin Daining 20 May 2013 18:58 question, complete

Hey Low,

First of all, great search module! I love it!

Second, I have a select drop down that needs to search 3 specific fields and only those fields. Right now I have it set up as follows:

select name="search:custom_field"

Is there a way to add more fields to that "search: " parameter?

Thanks

Justin
The Image Shoppe

Replies

  1. Low 20 May 2013 19:03

    Use it just like the native search:-parameter in the Channel Entries tag. So:

    name="search:field_name_1"
    name="search:field_name_2"

    etc.

  2. Low 21 May 2013 18:53

    Uh, I'd like to see your full Form tag code, then. You can use pastie.org which won't mess up your code.

  3. Justin Daining 21 May 2013 19:14

    Yeah... never mind about that either. Neither is working... Here's the form code...

    http://pastebin.com/EsnwmrT9

    Form is located at www.localfirst.com

    A search for "gazellle" in the Grand Rapids Area works

    A search for "gazelle" in the Holland Area does not work

    Thanks for take time to look at this.

  4. Low 21 May 2013 19:22

    First, change name="category:bus_cat[]" to name="category", since you're only using a single category group and a non-multiple select-element.

    What type is your cf_member_city? The syntax is correct, and it looks like the filtering actually works on that site.

  5. Justin Daining 21 May 2013 19:23

    cf_member_city is a text field

    address_three__c is a textarea

    Justin

  6. Low 21 May 2013 19:31

    Oh wait. Now I see...

    Are you're trying to search 2 custom fields with the same value? Like cf_member_city = 'foo' OR address_three__c = 'foo' ? Because that is not possible.

    A select element can only have one name="" attribute, so you can only target one field per element. If you want to target both fields, you'll have to create two elements. And when you do have two elements, they will work cumulatively; combining them with AND, not OR.