Skip Navigation

[Gelöst] Many to Many Relationships – Display View Based on Relationship Custom Fields

This support ticket is created vor 6 Jahren, 10 Monaten. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Dieses Thema enthält 6 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von GTD9219 vor 6 Jahren, 7 Monaten.

Assistiert von: Nigel.

Author
Artikel
#608753
toolset_2018-01-22_16-11-51.png
toolset_2018-01-22_16-06-57.png

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?

#608757

BTW... I have read through these:
wp-types.com/documentation/user-guides/querying-and-displaying-child-posts/
https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/ ... and many of the additional pages in the sidebar.

#608809

Nigel
Supporter

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+00:00)

Hi there

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.

#608887

Ok. Sorry for neglecting to add additional context for where the views were being displayed / implemented.

I thought no existing features were "lost" with the betas. My mistake.

How would I accomplish this in the current, non beta version?

#608951

Nigel
Supporter

Sprachen: Englisch (English ) Spanisch (Español )

Zeitzone: Europe/London (GMT+00:00)

You'll need to switch to the current stable plugin versions and set up your post relationships again.

The way you display related posts, so products connected to the person currently being displayed, is described here: https://toolset.com/documentation/beyond-the-basics/post-relationship-concepts/implementing-many-to-many-relationships/

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.

#701647

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.

As a reminder, the issue is the current stable release allows filtering views by custom field [of intermediary CPT for many-to-many relations] as detailed here: https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/

#701826

To clarify, I am trying to display a filtered view. There are two methods I'm aware of, but neither seems to work yet in the beta releases.

Method #1 = Modify the actual VIEW, as shown here: versteckter Link (source: https://toolset.com/documentation/user-guides/filtering-views-by-custom-fields/ )

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?

Is there any workaround?