Skip Navigation

[Resolved] Help getting intermediary field from many to many relationship.

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by Minesh 1 year ago.

Assisted by: Minesh.

Author
Posts
#2675533
book-review-by-library.png

Hello Team,

I have a products which is book and I have created a cpt name library. I want to struggling with a getting a intermediary field 'Book Review' from a many to many relationship between book and library. A library can write review on many different products and a single product can reviews from multiple library so many to many relationship is requirement in this case.

On product page I want all the reviews from different libraries and on library page I want all review which currently openend library wrote on different prouducts.

Can you help me what query I use for this or any other things I need. Please help.

I adding screenshot of my current query, which is showing same review on all products and library pages.

Regards

#2675557

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I see you set your view to query the intermediary post type as your view source.

When you set your view to query intermediary post type, you will have access to both parent and child post type fields as well as intermediary field.

I hope you already added the query filter for for your post relationship "Post relationship or repeatable field groups owner" and set your post relationship and as you want to display the related post on current page you should select the option "The post where this view is shown" and then within the view's loop editor you should add your intermediary post type fields and then your required parent and child post type fields.

More info:
- https://toolset.com/documentation/legacy-features/views-plugin/displaying-related-child-posts/

You can also use our free test platform http://www.discover-wp.com and use any of the reference site we offer that is build on top using Toolset to know how many-to-many post relationship works.

#2676083

Thanks for your help. Your guidance helped me a lot to get what I want.

#2676101

Hi,

Thanks for your help so far. I need some help on similar topic.

I have CPT Library and products on the site. There is many to many relationship between product and library with an intermediary post "book-review". I need to show all the non-blank book-review as slider for a random library on the home page. Can you please guide me on that too.

Thanks in advance

#2676249

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)