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
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
I will check tomorrow morning! Sorry but i was away!
Please update if you still need assistance for it, thanks
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
You can setup the view with classic editor:
Dashboard-> Toolset-> Views
Then you will be able to see the section "Loop Editor"
But i'm working with blocks, and if i change editor i have to start from scratch!!! This is the only way?
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
I have enabled the private message box, please provide your website credentials, also point out the problem page URL and form URL, thanks
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
My issue is resolved now. Thank you!