Skip Navigation

[Resolved] Display Many to Many fields in a post template

This support ticket is created 2 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.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by nadavL 2 years, 10 months ago.

Assisted by: Jamal.

Author
Posts
#2048081

Hi,

I'm building a traveling site and I have a Trips post type that displays an overview of places and I linked it (partnership) to Tours, which is a mother post type for specific tours in that location.

E.g you can read about Florida (trip) and in there see link or info about few tours in Florida.

I've gone over few tutorials and set the relationships and added few test posts of each type.
When I add a view, in the Trips posts template, and choose a single field, for example, I see all the Tours and not only those I partnered with that specific Trip.

I hope I was able to explain myself. I'm also not sure I did the right thing when setting a Post Reference field type for Tours (which I saw in another tutorial).
Anyway, you have an admin account from another ticket if that helps.

If you need more details please let me know.

Thanks

#2048233

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Hello and thank you for contacting the Toolset support.

Custom fields for many-to-many relationship intermediary posts will not be available in the dynamic sources for single fields. You need to use a view, and then you can use single fields inside the view's loop.

Keep in mind that when you try to pull data from multiple posts, you'll need a view. When you need to pull data from one post you can use the dynamic sources in blocks. Examples:
- Parent or Child post in One-to-One relationship: Can be pulled using dynamic sources
- Parent post in One-to-Many relationship: Can be pulled using dynamic sources.
- Children posts in One-to-Many relationship: Need a view of Child custom posts related to the parent post.

Check this section from this article https://toolset.com/course-lesson/many-to-many-post-relationships/#displaying-related-posts
And this article https://toolset.com/course-lesson/displaying-related-posts/

I hope this helps. Let me know if you have any questions.

#2053147

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.