Answers.Body: <p>Well, would this be what you are looking for? - <a href="https://github.com/iainurquhart/FacetedNav_CraftPlugin" rel="nofollow">https://github.com/iainurquhart/FacetedNav_CraftPlugin</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-24T19:16:01.000Z
Answers.Text: Might possibly work! Will give it a bash tomorrow.
Answers.UserDisplayName: Jason Mayo
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-26T14:05:08.693Z
Answers.Text: This worked, but I couldn't get it to work as a *form*. I managed to dig a bit deeper in to stack exchange and found a few related posts and learnt from them to create some code that worked well. Will post shortly.
Answers.UserDisplayName: Jason Mayo
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-17T11:24:28.423Z
Answers.Text: @JasonMayo can you please share related to search form as i stuck there.
Answers.UserDisplayName: inrsaurabh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-26T10:57:13.350Z
Answers.Text: @inrsaurabh See that accepted answer (Mine). I think that's what your asking for?
Answers.UserDisplayName: Jason Mayo
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-24T19:02:21.797Z
Answers.LastActivityDate: 2015-06-24T19:02:21.797Z
Answers.UserDisplayName: John
Answers.Body: <p>I managed to figure this out by looking through a few other posts:</p>
  
  <ul>
  <li><a href="https://craftcms.stackexchange.com/questions/1878/advanced-search">Advanced Search</a></li>
  <li><a href="https://craftcms.stackexchange.com/questions/6837/building-a-simple-search-by-multiple-categories?rq=1">Building a simple search by multiple categories</a></li>
  <li><a href="https://craftcms.stackexchange.com/questions/4571/building-results-from-advanced-search-form?rq=1">Building Results From Advanced Search Form</a></li>
  <li><a href="https://craftcms.stackexchange.com/questions/9081/how-to-filter-entries-by-clicking-multiple-categories-on-front-end?rq=1">How to filter entries by clicking multiple categories on front end</a></li>
  <li><a href="https://craftcms.stackexchange.com/questions/2086/fetching-entries-from-an-advanced-search-form-on-the-front-end?rq=1">Fetching entries from an advanced search form on the front end</a></li>
  </ul>
  
  <p>Which I then took their knowledge and put together my own form and results template. With the results I wanted the same code &amp; template to be used for search results AND the general "knowledge" page.</p>
  
  <p><strong>Filter Form</strong></p>
  
  <pre><code>&lt;form action="{{ url('knowledge') }}"&gt;
  
      &lt;ul&gt;
  
          {% set categoryEntries = craft.entries.limit(null) %}
  
          {% for category in craft.categories.group('knowledge') %}
  
              {% set categoriesEntryCount = categoryEntries.relatedTo(category).total() %}
  
              &lt;li&gt;
                &lt;input type="checkbox" name="category[]" value="{{ category.slug }}" id="{{ category.slug }}"&gt;
                &lt;label for="{{ category.slug }}"&gt;{{ category.title }} ({{ categoriesEntryCount }})&lt;/label&gt;
              &lt;/li&gt;
  
          {% endfor %}
  
      &lt;/ul&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>Results</strong></p>
  
  <pre><code>    {% set parameters =
          {
              section: 'channelKnowledge',
              limit: '1'
          }
      %}
  
      {% set categoryQuery = craft.request.getParam('category') %}
  
      {% if categoryQuery %}
          {% set categoryQueryCategories = craft.categories.group('knowledge').slug(categoryQuery) %}
          {% set entries = craft.entries(parameters).relatedTo(categoryQueryCategories).order('score') %}
      {% else %}
          {% set entries = craft.entries(parameters) %}
      {% endif %}
  
      {% paginate entries as channelKnowledgeEntries %}
  
      {% if entries|length %}
  
          {% for entry in channelKnowledgeEntries %}
  
              {{ entry.title }}
  
          {% endfor %}
  
      {% else %}
  
          &lt;p&gt;No Results&lt;/p&gt;
  
      {% endif %}
  
      {% if paginate %}
  
          &lt;div class="pagination"&gt;
              {% if paginate.prevUrl %}
                  &lt;span&gt;
                      &lt;a href="{{ paginate.prevUrl }}" class="back"&gt;Previous&lt;/a&gt;
                  &lt;/span&gt;
              {% endif %}
              &lt;ul&gt;
                  {% for page, url in paginate.getPrevUrls(5) %}
                      &lt;li&gt;
                          &lt;a href="{{ url }}"&gt;{{ page }}&lt;/a&gt;
                      &lt;/li&gt;
                  {% endfor %}
                  &lt;li&gt;
                      &lt;a href="" class="active"&gt;
                          {{ paginate.currentPage }}
                      &lt;/a&gt;
                  &lt;/li&gt;
                  {% for page, url in paginate.getNextUrls(5) %}
                      &lt;li&gt;
                          &lt;a href="{{ url }}"&gt;{{ page }}&lt;/a&gt;
                      &lt;/li&gt;
                  {% endfor %}
              &lt;/ul&gt;
              {% if paginate.nextUrl %}
                  &lt;span&gt;
                      &lt;a href="{{ paginate.nextUrl }}" class="forward"&gt;Next&lt;/a&gt;
                  &lt;/span&gt;
              {% endif %}
          &lt;/div&gt;
  
      {% endif %}
  
  {% endpaginate %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-26T14:49:09.303Z
Answers.LastActivityDate: 2015-06-26T14:49:09.303Z
Answers.LastEditDate: 2017-04-13T12:51:00.303Z
Answers.UserDisplayName: Jason Mayo
Body: <p>Previously on EE I've used Low Search to generate a filter based search form, based on categories. But with Craft I can't seem to find an add-on - Or even know if I need one!</p>
  
  <p>What I'm trying to achieve is a filer menu with categories e.g.:</p>
  
  <pre><code>[ ] Category 1
  [x] Category 2
  [ ] Category 3
  [x] Category 4
     [ ] Category 4.1
     [ ] Category 4.2
  [ ] Category 5
  </code></pre>
  
  <p>I've been reading over the documentation over at:</p>
  
  <p><a href="https://craftcms.com/docs/searching" rel="nofollow noreferrer">https://craftcms.com/docs/searching</a> and <a href="https://craftcms.com/docs/templating/search-form" rel="nofollow noreferrer">https://craftcms.com/docs/templating/search-form</a></p>
  
  <p>But I'm struggling to see how I can make this work within a search form itself. </p>
  
  <p>I'm thinking I can generate a query fine to search the categories. But I can't work out how to link what is checked with a query.</p>
  
  <p>Any help would be gooooood :)</p>
  
Tags: <search>
Title: Filter based Search Form
ThreadText: # Filter based Search Form
  
  (Asked by: username_0 on 2015-06-24)
  
  Previously on EE I've used Low Search to generate a filter based search form, based on categories. But with Craft I can't seem to find an add-on - Or even know if I need one!
  
  What I'm trying to achieve is a filer menu with categories e.g.:
  
  ```
  [ ] Category 1
  [x] Category 2
  [ ] Category 3
  [x] Category 4
     [ ] Category 4.1
     [ ] Category 4.2
  [ ] Category 5
  
  ```
  
  I've been reading over the documentation over at:
  
  <https://craftcms.com/docs/searching> and <https://craftcms.com/docs/templating/search-form>
  
  But I'm struggling to see how I can make this work within a search form itself.
  
  I'm thinking I can generate a query fine to search the categories. But I can't work out how to link what is checked with a query.
  
  Any help would be gooooood :)
  
  **Tags:** search
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2015-06-26. Score: 9 | Accepted answer
  
  I managed to figure this out by looking through a few other posts:
  
  * [Advanced Search](https://craftcms.stackexchange.com/questions/1878/advanced-search)
  * [Building a simple search by multiple categories](https://craftcms.stackexchange.com/questions/6837/building-a-simple-search-by-multiple-categories?rq=1)
  * [Building Results From Advanced Search Form](https://craftcms.stackexchange.com/questions/4571/building-results-from-advanced-search-form?rq=1)
  * [How to filter entries by clicking multiple categories on front end](https://craftcms.stackexchange.com/questions/9081/how-to-filter-entries-by-clicking-multiple-categories-on-front-end?rq=1)
  * [Fetching entries from an advanced search form on the front end](https://craftcms.stackexchange.com/questions/2086/fetching-entries-from-an-advanced-search-form-on-the-front-end?rq=1)
  
  Which I then took their knowledge and put together my own form and results template. With the results I wanted the same code & template to be used for search results AND the general "knowledge" page.
  
  **Filter Form**
  
  ```
  <form action="{{ url('knowledge') }}">
  
      <ul>
  
          {% set categoryEntries = craft.entries.limit(null) %}
  
          {% for category in craft.categories.group('knowledge') %}
  
              {% set categoriesEntryCount = categoryEntries.relatedTo(category).total() %}
  
              <li>
                <input type="checkbox" name="category[]" value="{{ category.slug }}" id="{{ category.slug }}">
                <label for="{{ category.slug }}">{{ category.title }} ({{ categoriesEntryCount }})</label>
              </li>
  
          {% endfor %}
  
      </ul>
  
  </form>
  
  ```
  
  **Results**
  
  ```
      {% set parameters =
          {
              section: 'channelKnowledge',
              limit: '1'
          }
      %}
  
      {% set categoryQuery = craft.request.getParam('category') %}
  
      {% if categoryQuery %}
          {% set categoryQueryCategories = craft.categories.group('knowledge').slug(categoryQuery) %}
          {% set entries = craft.entries(parameters).relatedTo(categoryQueryCategories).order('score') %}
      {% else %}
          {% set entries = craft.entries(parameters) %}
      {% endif %}
  
      {% paginate entries as channelKnowledgeEntries %}
  
      {% if entries|length %}
  
          {% for entry in channelKnowledgeEntries %}
  
              {{ entry.title }}
  
          {% endfor %}
  
      {% else %}
  
          <p>No Results</p>
  
      {% endif %}
  
      {% if paginate %}
  
          <div class="pagination">
              {% if paginate.prevUrl %}
                  <span>
                      <a href="{{ paginate.prevUrl }}" class="back">Previous</a>
                  </span>
              {% endif %}
              <ul>
                  {% for page, url in paginate.getPrevUrls(5) %}
                      <li>
                          <a href="{{ url }}">{{ page }}</a>
                      </li>
                  {% endfor %}
                  <li>
                      <a href="" class="active">
                          {{ paginate.currentPage }}
                      </a>
                  </li>
                  {% for page, url in paginate.getNextUrls(5) %}
                      <li>
                          <a href="{{ url }}">{{ page }}</a>
                      </li>
                  {% endfor %}
              </ul>
              {% if paginate.nextUrl %}
                  <span>
                      <a href="{{ paginate.nextUrl }}" class="forward">Next</a>
                  </span>
              {% endif %}
          </div>
  
      {% endif %}
  
  {% endpaginate %}
  
  ```
  
  
  ---
  
  ### Answer by username_1 on 2015-06-24. Score: 3
  
  Well, would this be what you are looking for? - <https://github.com/iainurquhart/FacetedNav_CraftPlugin>
  
  > **Comments:**
  > **username_0**: Might possibly work! Will give it a bash tomorrow.  
  > **username_0**: This worked, but I couldn't get it to work as a *form*. I managed to dig a bit deeper in to stack exchange and found a few related posts and learnt from them to create some code that worked well. Will post shortly.  
  > **username_2**: @username_0 can you please share related to search form as i stuck there.  
  > **username_0**: @username_2 See that accepted answer (Mine). I think that's what your asking for?  
  
  ---
  
  