Crocoblock / suggestions

The suggestions for CrocoBlock project
195 stars 78 forks source link

Hierarchical filtering posts using JetEngine relationship and JetSmartFilters #770

Open timtamb opened 4 years ago

timtamb commented 4 years ago

Hi there!

I’m creating a website for a project home builder, but it seems I've hit a roadblock while trying to make use of the JetEngine and JetSmartFilter plugins. Essentially, I'm trying to filter through every post in a particular custom post type by the meta data within the related CPT field set up using JetEngine.

As an example, let's say I have two CPTs, a Design Series type and a Floor Plan type. A Design Series has a 1 - many relationship with the Floor Plan post type using the relationship field in JetEngine. Each post type has a variety of unique custom meta fields (such as number of bedrooms, number of bathrooms, etc). I have a front-end page that displays every Design Series post in an Elementor posts widget with a JetSmartFilter placed above it. I would like a user to be able to filter through these Design Series posts based on the meta data stored in the related Floor Plans for each Design Series. For example, a user may only want to return Design Series that contain at least 1 Floor Plan that has 3 bedrooms, so when they select "3 bedrooms" in the filter section, I would like to filter through the Floor Plan meta data and if at least 1 of the Floor Plan posts matches the criteria, the corresponding Design Series will be returned in the search results.

Furthermore, I've noticed in your JetSmartFilters v1.6.0 Beta that you have added a new "hierarchical filtering" feature, and mentioned it would potentially be expanded:

For now, it works only with the Select type filter and only Taxonomy can be selected as a source. In the future, we’re going to expand the functionality. Moreover, it will be possible to build a hierarchy on the post relations basis.

I'm not entirely sure, but it sounds like this is the sort of thing I'm looking for. I think this will be a huge benefit to your product because it will facilitate better search functionality for people using related posts in their site. It's especially relevant for home building sites, as they all follow the same sort of structure with Design Series and Floor Plans.

For an example of this in the wild, try this link, and keeping an eye on the Aspen, set the bedrooms filter to 3: https://masterton.com.au/home-designs/

Hope this all makes sense!

NilsDannemann commented 3 years ago

I just ran into the same issue. Did you find a solution somehow?

CMRD77 commented 3 years ago

Same conundrum here, please, did you find a fix or a way to go or way to go through this?

gurdiny commented 2 years ago

I have the same problem :c

timtamb commented 2 years ago

Unfortunately, the solution for me was to move away from Crocoblock and WordPress entirely. Instead, I used Python and Django with the Wagtail CMS to implement what I needed with the magic of OOP. From the sounds of things, the Crocoblock team are yet to implement the highlighted feature in my original post that could potentially solve the problem you're all facing.