Skip Navigation

[Resolved] disconnect relationship link not showing in view

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

Problem:

A user reported that the "cred-delete-relationship" shortcode is not working inside one of the views.

Solution:

Guided that, in the "cred-delete-relationship" shortcode, the "role_items" attribute works in a view where a relationship filter is being used.

Since the view in question is not using any relationship filter, you'll need to replace the "role_items" attribute with the "related_item_one" and "related_item_two" attributes.

Relevant Documentation:

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

This support ticket is created 2 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by tims-9 2 years, 8 months ago.

Assisted by: Waqar.

Author
Posts
#2318939

Tell us what you are trying to do?
Display a link to disconnect a relationship in a view. The link/button does not show. Using the same technique in a different view it shows.
[cred-delete-relationship role_items='$fromViews' relationship='vehicle-consignment-note' type='button' class='btn btn-sm btn-dark']Delete[/cred-delete-relationship]

What is the link to your site?
hidden link

#2319085

Hi,

Thank you for contacting us and I'd be happy to assist.

To troubleshoot this, I'll need to see how both these views are set up in the admin area.

Can you please share temporary admin login details, along with the link to the page where disconnect a relationship link/button is showing?

Note: Your next reply will be private and it is recommended to make a complete backup copy, before sharing the access details.

regards,
Waqar

#2320953

Thank you for sharing these details.

As mentioned in the documentation on the "cred-delete-relationship" shortcode, the "role_items" attribute works in a view where a relationship filter is being used.
( ref: https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred-delete-relationship )

Since your view is not using any relationship filter, you'll need to replace the "role_items" attribute with the "related_item_one" and "related_item_two" attributes:


[cred-delete-relationship relationship='vehicle-consignment-note' related_item_one="[wpv-post-id item='@vehicle-consignment-note.parent']" related_item_two="$current" type='button' class='btn btn-sm btn-dark']Delete[/cred-delete-relationship]

You'll see that the delete relationships button is now showing, with this updated shortcode.

#2322227

My issue is resolved now. Thank you!