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

Support archive

search for screen_name

nathancrobertson 18 Feb 2015 02:02 question, complete

A search form we are building has the requirement to input all/part of a name to search by the author. Due to privacy requirements, we cannot use a pre-populated drop-down list of authors.

Here is my search form:

{exp:low_search:form result_page="master-anglers/find-a-master-angler/results" channel="bmac_fish"}
<select name='category[]' style="display:inline;width:100px;">
<option value='' selected="selected">All Species</option>
{exp:channel:categories channel="bmac_fish" style="linear"}
<option value='{category_id}'>{category_name}</option>
{/exp:channel:categories}
</select>

<input name="screen_name" type="text" value="" style="display:inline;width:150px;">

<strong>CAUGHT BETWEEN</strong>
<input name="start_on" type="date" value="05/01/2010" style="display:inline;width:210px;" gldp-id="mydate">

<strong>AND</strong>
<input name="stop_before" type="date" value="{current_time format="%m/%d/%Y"}" style="display:inline;width:210px;">

<input name="Search" type="submit" value="Search">

{/exp:low_search:form}


Can you please let me know what I'm missing? When I input a name it does not change the results.

Replies

  1. Low 18 Feb 2015 09:10

    The channel:entries tag doesn't have a screen_name parameter, so you can't filter by it. Unless you install Low Search Members, a Low Search filter available separately. Then you can use members:screen_name or members:search:screen_name to search for entries by their author's screen name. The former will expect an exact match, while the latter will accept partial matches, too. So that's your best bet here.

    Also, be aware that the channel="" param on the Form tag does nothing. You should add it to the Results tag instead.

    You can also name the select-element like this: name="category", without the square brackets, as you're only selecting a single category.

    Finally, check if the start_on and stop_before parameters have the correct date format as stated in the EE docs.