Hi,
I have a many to many relationship between 2 CPTs, and this relation has a custom checkbox field with 3 possible values.
I then have a view displaying all posts for the first CPT, and would need to add a filter for each one of the 3 possible values.
How should I set this up?
Thanks.
Hello,
Toolset Views/Blocks plugins are using WordPress class WP_Query to query posts, you can only filter the result by post fields of same post type, you can not filter the result by fields of another post type.
In you case, I suggest you try these:
Create a post view:
- Query posts of intermediate post type
- Filter by the custom checkbox field
- In view's loop, display the related "first CPT" post information
https://toolset.com/course-lesson/displaying-related-posts/#displaying-one-related-item-parent
Thank you.
As the matter a fact, I already have filters based on the current CPT's custom fields.
So I would need to both filter by the current CPT fields, AND the intermediary CPT fields.
How may I set this up?
As I mentioned above, there isn't such kind of built-in feature within Toolset plugins, you can add a feature request for it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
Our developers will evaluate it.
Currently, you might consider to move the custom checkboxes field into post type "first CPT"