Skip Navigation

[Resolved] Relationships

This support ticket is created 5 years, 8 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 5 years, 8 months ago.

Assisted by: Nigel.

Author
Posts
#1226986

I cannot add a relationship field to my CRED form that will offer a multiple selector.

#1227020

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Eric

I picked up both your threads, I'll reply to this one first as it is more straightforward.

You can only add a parent selector to a normal form, i.e. the "one" part of a one-to-many relationship.

If you need to add a selector for the "many" part of a relationship, well you can't. You need to use relationship forms to connect existing posts in that case (see https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/).

It is a limitation of the implementation of post relationships in Toolset Forms. You might want to add your voice for bringing parity between post relationships in the back end edit screens and front-end Forms here: https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

If you really need a selector for the many part of a relationship in a normal form then you would need to implement it yourself, setting up the select dropdown populated by the relevant posts, and then using the cred_save_data hook (https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data) to manually attach the posts using the toolset_connect_posts API function (https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_connect_posts).