Navigation überspringen

[Gelöst] disconnect relationship link not showing in view

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

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 vor 4 years. 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 -

Zeitzone des Unterstützers: Asia/Karachi (GMT+05:00)

Dieses Thema enthält 3 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von tims-9 vor 4 years.

Assistiert von: Waqar.

Author
Artikel
#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?
versteckter 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!