Any help would be appreciated
Currently I’m working on a blog page project which has different categories. Both category and blog post are dynamic. But I want category as filter. Suppose when a visitor click on a certain category the page will only show that category related post. I know it can done through conditional visibility but i don’t know how to make that happen. Can anyone help me with this ?
Any video tutorial would be a great help for me
Thanks in advance
Remember that filtering is also loading a new page, so you can create a menu of CMS categories that will link to each category template.
Inside the template, filter the blogs to belong to the “current category” and place the same menu inside the page. This will create a filter by category.
Let me know if it helps
Can you provide me a video tutorial ? It will be a great help for me
Hi ahmedsani355! If you just want a simple way to filter your blog posts by category I would suggest that you create a reference field in your blog post collection and link every post to a category. You can also use a multi-reference field if you need to connect a post to several categories.
When that is done, you can go to the category collection page and add a collection list with your blog posts. Go to the element settings (shortcut “D”) and add a filter (“reference field name” equals “current category”).
To create the filter links you add another collection list and connect it to your categories. Then you can place a link inside the collection list and set it to dynamically display the name of the category and link to that category page.
Check out the links below for more information on reference fields:
I would also encourage you to check out the Finsweet CMS-library and use it for the filtering! It is really powerful and could solve your problem while also adding more advanced filtering if you wish, but it does require you to copy and paste some code into your project. Check it out here: https://cmsdocs.webflow.io/#filter.
What do we do when “Current Category” is mysteriously missing from the drop-down filter? This is terribly frustrating.
“Current category” will only show if you have placed the collection list on a category template page:)
Thank you for your response! I did figure that out eventually. One final question: What is the best way to link to a collection page from a static page? The only way I’ve found is to wait until the site is live, and assign a url to a link/button.
Is this correct?
There are two ways to do it:
The first one is copying the page URL directly as you have already done. The other is to add a collection list with a filter so that it only displays the item you want to link to and then add a link block of text link inside it and link it to the “current item”.
Unfortunately, I don’t think there are other ways to do it:(
Thank you! The second option works just fine for our purposes. Huge help!