Hello OctoberCMS Community,
recently, I am stuck trying to create a simple filter for my Homepage.
I have a projects.yaml blueprint to store all my Projects. Each of those projects can belong to multiple categories. It looks like this:
fields:
category:
label: Type of Project
type: checkboxlist
options:
Illustration: Illustration
Animation: Animation
Painting: Painting
Projects are implemented under the Markup section like this:
<div class="projects-grid" id="project-list">
{% for project in projects %}
<a href="https://website.art/projects/{{ project.slug }}" class="projectlink {{ project.thumbnail_span }}" title="{{ project.title}}">
<img src="{{ project.thumbnail_image.path }}" alt="Thumbnail image of {{ project.title}}" class="projectthumb">
<div class="linktext">
<h2>{{ project.title}}</h2>
<p>{{ project.description}}</p>
</div>
</a>
{% endfor %}
</div>
Now I have these filter chips on my website.
With those I want to filter through categories, meaning when e.g. two chips are enabled, only projects of those categories would appear to be on the page. And when I change my selection the page would automatically update.
The issue is that I have no clue of how to implement it. But I figured, as always, there has to be an easy and efficient way to do so, I just don’t happen to be knowledgable enough with OctoberCMS/Programming.
I would be more than delighted if anyone knows a neat solution to this.
Or any kind of tutorial/example page to see how it works. Sadly, OctoberCMS Tutorials are rare and the Documentation doesn’t help a selftaught person like me a lot yet.
Thanks a lot and have a great day. ^-^
Robin