Skip Navigation

[Resolved] Show different post info by parent relationship

This thread is resolved. Here is a description of the problem and solution.

Problem: I have an M2M relationship, and I would like to store some custom field values specific to each relationship between two posts.

Solution: When creating a M2M relationship, it is possible to assign custom fields to the intermediary post type. This allows you to store information about each connection between two posts.

Relevant Documentation:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-information-from-intermediary-post-types

100% of people find this useful.

This support ticket is created 6 years, 4 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.

Our next available supporter will start replying to tickets in about 8.15 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 3 voices.

Last updated by Christian Cox 6 years, 4 months ago.

Assisted by: Christian Cox.

Author
Posts
#921872
imdb.png

Hi,
I have a relationship between 2 posts Art and People. I need to show the People position (custom field), but this position changes in every Art.

Is the same with happens in IMDB with Actors and their Character that changes in every movie.

Is this possible?

Thanks in advance!

#921971

Well, you can show any field belonging to People or Art in a View, which queries the respective Post Type, in your case probably "People".
Then, in the View Loop, you simply insert the ShortCode for the Custom Field which you will find in the "Fields and Views" GUI (Guided User Interface).

That View can have a Query Filter so to display just People posts that are somehow related to a Art (wether current post, parent post, or other):
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/

#922100

Hi Beda,

I know how to do that, my situation is someting more complex.
I need to do the following:

Play 1-> Person1 (Director)
Person2 (Guionist)

Art 4 -> Person1 (Creative Artist)
Person3 (Gallery Owner)

In the example Person1 are the same person, but they have different roles/positions that I have to show bellow their name.

I know how to display the people related but not the secondary info (field). One person will have many different positions (Creator, Director, Co-director, Producer, etc) but just one will be display for every Art/play.

There is a way to do this?

Thanks!!

#922240

Hi, it sounds like you want to apply custom fields to this relationship, then display those field values. We have a document available here that explains how to add custom fields to the intermediary post type, then display those field values on your site: https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-information-from-intermediary-post-types

Please let me know if you have additional questions about that.