Guest User

Low Search - Checkboxes

a guest
Oct 1st, 2013
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {!------------/Search Form/--------------}
  2. {exp:low_search:form query="{segment_2}" require_all="category" result_page="/dev/" form_id="sidebar-category-search" secure="no"}
  3.   <fieldset>
  4. {exp:channel:categories channel="entries" category_group="6" show_empty="yes"}
  5.     <label class="category-checkbox">
  6.     <input type="checkbox" name="category[]" value="{category_id}" {if category_id IN         ({low_search_category})}checked="checked"{/if}/>{category_name}</label>
  7.       {/exp:channel:categories}
  8.     <button type="submit">Search</button>
  9.   </fieldset>
  10. {/exp:low_search:form}
  11.  
  12. {!------------/SEARCH RESULTS/--------------}
  13. {exp:low_search:results query="{segment_2}" limit="9"}
  14.   {if count ==  1}
  15.     {if '{low_search_category}' != ''}
  16.     <p>Selected Categories:
  17.     {exp:channel:categories show="{low_search_category}" channel="entries" style="linear" backspace="2"}{category_name}, {/exp:channel:categories}
  18.     </p>   
  19.     {/if}
  20.     <ul>
  21.   {/if}
  22.  
  23. <div>
  24.     <li>{title}</li>
  25. </div>
  26.  
  27.   {if count == total_results}</ul>{/if}
  28.   {if no_results}No search results{/if}
  29.  
  30. {/exp:low_search:results}
Advertisement
Add Comment
Please, Sign In to add comment