Skip Navigation

[Resolved] delete post connection using post relationship form

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

Problem:
delete post connection using post relationship form with many to many relationship

Solution:
You need a view to display related posts of many to many post relationship and then you should add the delete link for to disconnect the connections.

You can find the proposed solution, in this case with the following reply:
https://toolset.com/forums/topic/form-submission/#post-1251151

Relevant Documentation:
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/editing-existing-connections-between-related-posts/#deleting-existing-connections-between-posts

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
- 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 9 replies, has 2 voices.

Last updated by mindyB 5 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#1247453
Screenshot 2019-05-22 20.45.30.png

Tell us what you are trying to do?
The Front end user edit form is made of two parts: one for editing "A" and one for editing the relationships between "A" and "B" - This means there are two submit buttons. This is a bit confusing. Is there another way to do this - for front end editing?

The image I attached has the bottom part of the edit of "A" - the vendor. With a submit button. The attendance (relationship form between vendors and farmers markets follow) with it's own submit button.

Please advise - can there be only one submit button? etc.

#1247543

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Well - Edit post forms (used to edit a single post) and post-relationship forms (used to connect the posts) both are different entities. You can not combine them into one form as this is not how post-relationship forms work.

Please check the below Doc to see how post-relationship forms works:
=> https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/

And here is the Doc how post edit forms works:
=> https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-editing/

#1249699

I'm reading the documentation again.
I would like to tie it into Elementor template - not sure if the documentation includes this.

Also how to you delete an existing relationship between A an B.

(It's much more intuitive on the back end)

#1250623

Minesh
Supporter

Languages: English (English )

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

Also how to you delete an existing relationship between A an B.
==> Well - to disconnect the posts you can use the post-relationship API function: toolset_disconnect_posts
- https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_disconnect_posts

But I would like to know at what point and using which form you want to delete an existing relationship between A and B?

Can you please check the following video that may help you as well:
=> hidden link

#1250819

Questions:

1: The Vendor has attends three farmers markets ( x, y, z). How does the vendor on the front end, change his/her farmers markets to (x, z), that is, how does the vendor on the front end remove the "y" farmers market?

2: I've been following the documentation " Editing Existing Connections Between Related Posts" - I have set up a many to many relationship between farmers markets and vendors. I'm editing the content template, and adding the Toolset Form. It says to select the "create an 'editing-mode' template for managing songs appearing on an album. " When I try to do this step - I can't select this option. What should I do next?

#1250833

Minesh
Supporter

Languages: English (English )

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

Well - can you please share access details and problem URL and which relationshp form you created?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1251051

Minesh
Supporter

Languages: English (English )

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

Ok - thank you for sharing access details. I checked you created the Edit relationship form: Edit Attendances

But to disconnect the posts there is no way for now as post-relationship API feature still needs to be implemented and its set to release with the Tooslet Forms version 2.5 in near future, there is no ETA on it as by today or tomorrow we set to release the BETA version for Toolset forms version 2.4.

Now, I would like to know where exactly you want to display your relationship form? on which post/poge?

#1251107
Screenshot 2019-05-27 10.19.42.png

1. You mean I have to edit from back end when a vendor says they're not related to a certain market?

2. Using the elementor templates - they are listed as published.... and can be found there.

#1251151

Minesh
Supporter

Languages: English (English )

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

Ok - after looking more closely, with many to many relationships we do have a shortcode to delete the relationship.

I've created the view "display-related-posts-for-vendors":
=> hidden link

I've added the above view just after the "Attendances" on single post template of "Vendors":
=> hidden link

As you can see we able to display edit link as well as delete link.

More info:
=> https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/editing-existing-connections-between-related-posts/#deleting-existing-connections-between-posts

#1251189

My issue is resolved now. Thank you!