Has anyone applied dynamic filtering to posts like the ones ghost use on the admin?

I am using ghost to display over 500 ceiling fans, of course we have lots of colors, brands and sizes. That is ideal for letting users to filter products without reloading posts. (in our case posts are products) I ve noticed on the admin one can filter out posts by any tag and if you scroll down the admin keeps loading the correct filtered posts. This is exactly the kind of thing i want to implement. Does anyone have applied this kind of filters to a ghost template? why we dont have templates like these on ghost marketplace? Maybe no one is using ghost to filter products? Are jquery filters going to keep working even if the user is scrolling down and casper keeps loading products? Thanks in advanced.

Hey!!

In casper we have this infinite scroll script (https://github.com/TryGhost/Casper/blob/master/assets/js/infinitescroll.js) Which 1) looks for the “next” link at the bottom of a page, 2) Loads in the content via XHR 3) Attaches the content to the current page.

This works well for non-filtered infinite scroll - and I think you could probably apply some jquery filter plugin and have it work correctly - this might be the quickest way?

Another option would be to use the Content API (Ghost Content API Documentation) and dynamically loads filtered posts (in JSON format) - this would require you to then convert the JSON to markup and apply it to the page!

Both approaches should work though!

Hope this helps you build your site :relaxed:

1 Like

Thank you for your help Fabien!