0

With Solspace Super Search the manual says to use name='title" to search the title field. The issue is the results URL simply favors and outputs only the second select statement so title=whatevervalue whereas you want title=whatevervalue&title=anothervalue.

How do you deal with searching for two title fields from two different channels?

Thanks in advance for any help on this.

<select channel="workplace" name="title" class="Textbox4" >
                    <option value="">&nbsp;</option>
                    {exp:channel:entries channel="workplace" sort="asc" dynamic="no" orderby="title"}
                    <option value="{url_title}"  >{title}</option>
                    {/exp:channel:entries}
                </select>

                    {exp:channel:entries channel="places" orderby="title" sort="asc" dynamic="no" category="1"}
<option value="">&nbsp;</option>
                        <option value="{url_title}" >{title}</option>
                    {/exp:channel:entries}
                    </select>
{/exp:super_search:search}

1 Answer 1

1

Try adding && after your field values:

<option value="{title}&&">{title}</option>

In Super Search, this can be used to make "AND" searches (eg. title A AND B)

Since you want to search more than one title at once, you need your field to allow an array of data. You can do this with a select field that accepts multiple values or with checkboxes. Eg:

<select name="title[]" multiple="multiple">

Note: Notice the brackets [] next to title: this is needed to send an array of data instead of a string of data. That's just how HTML forms work.

Note 2: In your select field, you have the other following issues:

  • channel="" is not a valid attribute for select fields in HTML.
  • If you're searching in titles, you need to use value="{title}" and not value="{url_title}". If you're searching for a url_title instead, value="{url_title}" would be used.
  • You're missing an opening <select> tag before your second {exp:channel:entries} tag pair, if you need two select fields (if you need one select field, you have a closing </select> field too many.
  • You have a leftover closing {/exp:super_search:search} tag in your code. You should remove that (btw, {exp:super_search:search} is often not needed in Super Search search forms)
1
  • Thank you. Everything is working much better, but the two select fields are not properly working in terms AND/OR functionality with the results they return. The "work" will return results even though those people don't live in that city. work="Building"&workplaces=South/
    – jsuissa
    Commented Nov 16, 2015 at 0:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.