Skip Navigation

[Resolved] Adding relationship field to front end form

This support ticket is created 4 years, 2 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by Timothy 4 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#1811375

Hi,

I have created a cpt Notes and created it a many-to-many relationship with the standard posts. I have a front end form to add new Notes and I want to be able to select the Post to associate it with. You can see the start I have here:

hidden link (pass: notes)

Also not sure why but the date field does not work in this form.

Thanks,

Tim

#1811539

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Timothy,

Thank you for getting in touch.

Given that you are using a Many to Many relationship you won't be able to add the relationship to the Post creation form.

What you will need to do is to create a completely separate relationship form by going to Toolset -> Relationship Forms in order to setup the relationship on the frontend. See our documentation below.
https://toolset.com/course-lesson/front-end-relationship-forms-for-connecting-posts/

Please let me know if this helps.
Thanks,
Shane

#1811887

Thanks for the link but I'm not using the Block editor so that doesn't really help, isn't there better documentation on this? I tried to create a Relationship Form but it doesn't seem to work, on the font end it says "The item to connect items to can not be connected with this relationship". But is the overall process to do this (create a new Note and associate it with a post) to actually have 2 forms? A relationship form then an Add note form? This would be super clunky and basically not a usable solution.

Tim

#1812689

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Timothy,

For Many to Many relationships it will require that you have a separate relationship form to connect the posts on the frontend. Only one to many relationships can have the Post and Relationship creation all on one form.

Our development team is working to improve this but currently this is the only way to connect the many to many relationships on the frontend.

Thanks,
Shane

#1813471

That's too bad, it basically makes front-end many to many post adding unusable. Hopefully that improvement comes soon.

So I just deleted the many-to-many relationship and created a new one-to-many relationship(Many notes to one Post) and added the appropriate field to the form:

[cred_field field='@post-note.parent' class='form-control' output='bootstrap' select_text='--- not set ---' order='date']

But the Posts are not appearing in this select field. You can see what I mean here:
hidden link (pass: notes)

#1813485

Following this post:
https://toolset.com/forums/topic/post-relationship-form-not-showing-up-all-parents-for-selection/

I added this use_select2="never" to the shortcode and it seems to now work:
[cred_field field='@post-note.parent' class='form-control' output='bootstrap' select_text='--- not set ---' order='date' value='select' use_select2="never"]

Is this the necessary adjustment?

Tim

#1813887

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tim,

Happy to see that it's working for you.

Secondly no this shouldn't be a necessary adjustment as the posts should show up. Is it that when you type in the name of the post that you want to select as the parent it doesn't work ?

Or is it that you just want to see the predefined listing ?

Please let me know.
Thanks,
Shane

#1814635

My issue is resolved now. Thank you!