Advertisement
garabedium

Low Search

Mar 7th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 2.03 KB | None | 0 0
  1. {exp:low_search:form query="{segment_2}" result_page="/search/results" form_id="search" form_class="custom"}       
  2.  
  3.       <label>Category 1</label>
  4.         <select name="category[]">
  5.           {exp:channel:categories channel="jobs" category_group="3" style="linear"}
  6.             <option value="{category_id}"{if category_id IN ({low_search_category})} selected{/if}>
  7.               {category_name}
  8.             </option>
  9.           {/exp:channel:categories}
  10.         </select>  
  11.    
  12.       <h3>Category 2</h3>
  13.         <select name="category[]">
  14.           <option value="">Search all categories</option>
  15.           {exp:channel:categories channel="jobs" category_group="2" style="linear"}
  16.             <option value="{category_id}"{if category_id IN ({low_search_category})} selected{/if}>
  17.               {category_name}
  18.             </option>
  19.           {/exp:channel:categories}
  20.         </select>              
  21.    
  22.          <input type="hidden" name="require_all[]" value="category">
  23.          <input class="button" type="submit" value="Search">
  24.    
  25. {/exp:low_search:form}  
  26.                    
  27.        
  28. <ol class="posts">
  29.  
  30.   {exp:low_search:results channel="jobs" query="{segment_2}" limit="5" status="open|featured"}
  31.  
  32.     <li {if status == "Featured"}class="featured"{/if}>
  33.       {if status == "Featured"}<span class="featured-badge">Featured</span>{/if}
  34.       <a href="{path='jobs/{entry_id}/{url_title}'}">{title}</a>
  35.       <span class="meta"><a href="{path='jobs/{entry_id}/{url_title}'}">{categories show_group="3" limit="1"}{category_name}{/categories}</a></span>
  36.     </li>  
  37.  
  38.     {exp:stash:set name="search_results_header" parse_tags="yes" parse_conditionals="yes"}
  39.            
  40.         <p class="lead"><span class="amount">{count}</span> job{if count > 1}s{/if} found for </p>
  41.                    
  42.         <h1>
  43.         {exp:gwcode_categories show="{low_search_category}" channel="jobs" style="linear" limit="2" show_empty="no"}
  44.             {if cat_count == 2}<small>{/if} {cat_name} {if cat_count == 2}</small>{/if}
  45.         {/exp:gwcode_categories}
  46.         </h1>
  47.                                        
  48.    {/exp:stash:set}
  49.    
  50.  {/exp:low_search:results}
  51.  
  52. </ol>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement