Hi everyone,
I have two questions about filtering. On the website I’m working on, there is a page with a listing of companies. Now I would like the visitor to be able to filter these companies. At first I wanted use taxonomy categories for this, but since I want the admin to choose from a limited amount of categories, I decided to create a custom categories select input. In the YAML it looks like this:
Thanks for your reply! Reading back my first post; hmm not so clear Had been staring at the issue for too long, so was a bit numb :).
Anyhow, my main question is: how can I filter the posts on a listing page? By following the instructions in this forumpost, I managed to get a menu with a list of the taxonomies by doing this:
{% set taxlist = taxonomylist.get() %}
{% if taxlist %}
{% set category = grav.uri.params("category", true) %}
{% for tax,value in taxlist['category'] %}
{% set current_page = (tax == category) ? 'active' : '' %}
<li class="{{ current_page }}">
<a href="{{ base_url }}/category{{ config.system.param_sep }},{{ tax|e('url') }}">{{ tax|capitalize }}</a>
</li>
{% endfor %}
{% endif %}