Skip to content

Instantly share code, notes, and snippets.

@objectivehtml
Created November 11, 2013 22:13
Show Gist options
  • Save objectivehtml/7421428 to your computer and use it in GitHub Desktop.
Save objectivehtml/7421428 to your computer and use it in GitHub Desktop.
Channel Search - Search by Categories
<h3>Categories</h3>
{exp:channel_search:form id="Category Search" method="post"}
<ul>
{categories}
<li><label><input type="checkbox" name="category[]" value="{category_url_title}" {checked} /> {category_name}</label></li>
{/categories}
</ul>
<button type="submit" class="button">Search</button>
{/exp:channel_search:form}
<hr>
<h3>Results</h3>
<div class="results">
{exp:channel_search:results id="Category Search"}
{if no_results}
<p>No entries have been assigned to this category.</p>
{/if}
{if has_not_searched}
<p>You have not searched any categories yet.</p>
{/if}
{if has_searched}
{color_photo}
{/if}
{/exp:channel_search:results}
</div>
<style type="text/css">
.results img { width: 200px; margin: 0 10px 10px 0; }
.results img:nth-child(3n) { clear: left; }
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment