Passer la navigation

[Résolu] Add delete button on Front End Relationship Form

This support ticket is created Il y a 3 years, 8 months. 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Fuseau horaire du supporter : Asia/Hong_Kong (GMT+08:00)

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par nicholasH-6 Il y a 3 years, 8 months.

Assisté par: Luo Yang.

Auteur
Publications
#2483367

Tell us what you are trying to do?
Hi. Loving Toolset - Thank you! Well done! I have a Front End form that uses the following code to display a form with the child (Complaint) pre-populated from the query string sent from the previous page.

[cred-relationship-form form='assign-investigator-to-complaint' child_item='[current_case]']

The shortcode [current_case] gets the query string sent from the previous page which is the Complaint ID that we're adding an Investigator to. The relationship is one (Complaint) to Many (Investigators). I'm looking to add a Delete button that deletes the relationship and so removes the Investigator from that Complaint. The Front end forms are all hidden behind logins so I'd need to give you Login details to look at it properly. I'm not sure how to send you login details securely.

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?
lien caché

#2483633

Hello,

You can try Toolset Forms shortcode: [cred-delete-relationship], for example, if it is in a post view querying child investigator posts, you can use below shortcode:
[cred-delete-relationship type="button" role_items='$fromViews' relationship='complaint-investigator' redirect='self']Disconnect relationship[/cred-delete-relationship]

See below test site:
Login URL:
lien caché
Single Complaint post:
lien caché
Click button "Disconnect relationship"

More help:
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred-delete-relationship

#2484943

My issue is resolved now. Thank you!