Skip Navigation

[Resolved] Multiple Child Posts in Many to Many relationships

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

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 2 replies, has 2 voices.

Last updated by michael 7 years, 5 months ago.

Assisted by: Beda.

Author
Posts
#528977
screenshot-www.michaelnloewenberg.com-2017-05-26-14-54-38.png

On my client's website that we are building in a sandbox, I have set up a many to many relationship using an intermediary custom post type. We are using Woocommerce and the products are Machines. The three CPTs are Companies, Contacts and Ownership (the intermediary post type).

(fyi but not relevant: we have injected the company and contact post types with the WooCommerce product taxonomy using code in the functions file)

Companies own Machines. Contacts are children of Companies. So the Company CPT is the parent of the Contact CPT and the Ownership CPT.

When I edit an entry in the Company CPT, in the "post relationship" meta-box, I properly get two elements: contacts and ownerships. I can add a new contact without issue so I can have multiple contacts associated with the company. I need to be able to assign multiple machines to accompany under the "ownerships" type, but when I add a new ownership, it blanks out the previous one. I've attached a screenshot of the Post Relationship meta box.

How can I have multiple machines and multiple contacts associated with the company?

Thanks!

#529149

As far I see, you have the Post Type " Company", that has 2 Child Post Types, the "Contacts" and the "Ownerships".

So, when you edit a Company, save it, you can add those as child Posts, as you show me in the Screenshot.

This works fine.
There will be no greyed out posts, those will all be listed as Childs in that metabox.

Could you show me what you mean with "it blanks out the previous one"?

I cannot replicate this.

#532023

I'm all set. This was the case of the parent needing to be saved before children can be added.

Thank you.