Skip Navigation

[Resolved] Can CRED be used to set up many to many Relationships?

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

Problem:
Can I use CRED; to create Posts in a Many to Many Relation, as I can in the WordPress Backend?

Solution:
This is not possible in CRED.

There is a similar approach:

1. Create a CRED form that creates Parent Posts of type A
https://toolset.com/documentation/user-guides/creating-cred-forms/

2. Create a CRED Form that creates Intermediary Child Post types

3. This CRED form should hold the Parent Post-Selector for the "other" parent Post Type (Type B)
Also, you will insert the Parent Post-Selector for Type A, but hide it in a "

"

4. Insert this Form to a page

5. In the Parent Posts Content Template (or post body) for the Post which the Parent Post CRED Form for Type A form creates, insert a "Child Post CRED Link" and link it to the above page (The GUI will guide you through the steps)
https://toolset.com/documentation/user-guides/cred-forms-for-child-content/

6. Choose to set the parent according to this Post when inserting the CRED Link

7. Now see your Parent Post Type A and click on the create child post link

8. This will automatically set Parent Post type A, and you can then choose parent Post Type B in the Form

This support ticket is created 7 years, 9 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
- - 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 Tim 7 years, 8 months ago.

Assisted by: Beda.

Author
Posts
#402379

Tim

I am trying to: create a CRED form to add a post that has a many to many relationship.

Can I create that record AND add the intermediate post type on the form (similar to the back end form)

eg. hidden link

#402493

In the WordPress backend, you can create a Parent Post, save it, and then from within the Child Posts table, add the Intermediary Child Post and choose it's parent as well (if a parent exists already)

Above process is not possible in CRED.

What you can do, is follow this approach:

1. Create a CRED form that creates Parent Posts of type A
https://toolset.com/documentation/user-guides/creating-cred-forms/

2. Create a CRED Form that creates Intermediary Child Post types

3. This CRED form should hold the Parent Post-Selector for the "other" parent Post Type (Type B)
Also, you will insert the Parent Post-Selector for Type A, but hide it in a "<div hidden>"

4. Insert this Form to a page

5. In the Parent Posts Content Template (or post body) for the Post which the Parent Post CRED Form for Type A form creates, insert a "Child Post CRED Link" and link it to the above page (The GUI will guide you through the steps)
https://toolset.com/documentation/user-guides/cred-forms-for-child-content/

6. Choose to set the parent according to this Post when inserting the CRED Link

7. Now see your Parent Post Type A and click on the create child post link

8. This will automatically set Parent Post type A, and you can then choose parent Post Type B in the Form

#402598

Tim

Thank you for the straightforward answer and well explained example to work with.

Cheers, Tim

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