[Resolved] Many to Many Relationships – Display View Based on Relationship Custom Fields
This support ticket is created 6 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I have many to many relationships between two CPTs
CPT1: People
CPT2: Product
M2M CPT: People Product
For the M2M Person-Product CPT, I have a select field (field = Relationship Type) with three options:
DIsplay Text | Custom Field Content:
Recommends | recommends
Authored | authored
About | about
I created a View...
Post relationship filter: Select posts that are in the People Products relationship as related Products of
[o] Post where this view is shown
The goal = show only the related posts with Relationship Type = "authored" ... not ALL related posts.
I can't seem to figure out how to do that... any idea?
I understand your description of your post relationships and associated custom fields, but I don't quite follow from your question what you are trying to display where.
What page are you adding the View to?
A people post? And you want to display products connected to that person, but only those with the authored relationship type custom field value, is that right?
The current documentation for post relationships describes the current implementation, where this is possible.
It is not currently possible with the betas.
I tested that myself and the spoke to the developers.
It is currently being worked on, along with many other updates, and it is hoped that it will make it into the next beta release, but it could slip to the following release.
What's particular to your set-up is that you make the intermediate post type and assign a custom field group to it and add custom fields to those intermediate posts as required. Then with the View that queries this intermediate post type you can add a filter for your custom field as you normally would.
If that's still not clear let me know and I'll elaborate.
I know it has been a while... but I thought I would reach out to see if any of the new beta releases support this yet AND/OR the final release is planned to have this feature.
Method #2 = Create a general view and then try to filter it based on a shortcode parameter, like below:
[wpv-view name="recommended-products" order="asc" wpcf-relationshiptype="authored"]
Is this going to be resolved at some point? Any kind of ETA whatsoever?