Skip Navigation

[Resolved] Disconnect relationship

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

Problem:

I have two post type with a relationship and i need a button on front-end for disconnect the relationships. In this case is one-to-one, but i will need also for other cases (one-to-many and many-to-many).

I have added a "fields and text" and added a Form... but I can't find a delete relationship.

Solution:

It needs a post view, for example:

https://toolset.com/forums/topic/disconnect-relationship/#post-2075473

Relevant Documentation:

This support ticket is created 3 years, 5 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 – 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 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 10 replies, has 2 voices.

Last updated by patrizioT 3 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#2074917

I have two post type with a relationship and i need a button on front-end for disconnect the relationships. In this case is one-to-one, but i will need also for other cases (one-to-many and many-to-many).

I have added a "fields and text" and added a Form... but i can't find a delete relationship.

What i have to do? I have read that at the moment it's also only possible for admin user? i'm correct?

Best regards

#2075473
Delete-relationship.JPG

Hello,

It needs a post view, for example there are two post types in your website:
- CPT1
- CPT2
One-to-one relationship between above post types.

In the single CPT1 post, Create a post view:
- Query the "CPT2" posts
- Filter by the relationship between CPT1 and CPT2
- In view's loop, section "Loop Editor", click button "Toolset Forms", you will find the button "Delete relationship", see my screenshot Delete-relationship.JPG

#2078549

I will check tomorrow morning! Sorry but i was away!

#2078713

Please update if you still need assistance for it, thanks

#2078989

Hello,
i'm trying to do what you write, but i can't find "Loop editor" in view's loop. Can you show me some picture about it? THX

#2078993

You can setup the view with classic editor:
Dashboard-> Toolset-> Views

Then you will be able to see the section "Loop Editor"

#2078997

But i'm working with blocks, and if i change editor i have to start from scratch!!! This is the only way?

#2079021

I'm trying to do with classic editor, but i'm still can do it! Doesn't appear the button "Delete relationship", what i have to do? Can you access my site for a check? THX

#2079023

I have enabled the private message box, please provide your website credentials, also point out the problem page URL and form URL, thanks

#2079053

I have done below modifications in your website:
1) Edit the post view "Veicolo Milite scheda":
hidden link
in section "Loop Editor", click button "Toolset Forms", click button "Delete relationship", setup the shortcode like this:
[cred-delete-relationship role_items='$fromViews' relationship='milite-veicolo' redirect='self']Delete this relationship[/cred-delete-relationship]

2) Edit the content template "Template for Militi":
hidden link
At the bottom, add a view block, choose above post view "Veicolo Milite scheda"

Test it in front-end, for example:
hidden link

It works fine

Can you confirm it? thanks

#2079107

My issue is resolved now. Thank you!