Skip Navigation

[Resolved] Add an edit & disconnect on a single page for an existing relationship

This support ticket is created 4 years, 9 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 6 replies, has 2 voices.

Last updated by tobiasF-3 4 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#1481179

I am trying to add buttons to edit or disconnect two posts:
hidden link

On the right side you see 'Contacts'
Both agent and contact are connected with a relationship forms for these relationships

actor-profile-contact
and
actor-profile-company

to the actor profile

But what I am struggling with is to add the buttons to edit or remove the connection again.

I have tried to follow the instructions on the toolset website in detail but somehow it just does not work, the shortcodes are not even showing up?

Thanks for your help!
Tobias

#1481181

Here are the relationships:
hidden link
hidden link

the reladtionship forms:
hidden link

and here the content templates with the form:
hidden link

and the content template for actor profiles:
hidden link

Thanks for looking into this!

#1482517

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2020-01-28 at 08.57.46.png

Hi Tobi

If you look at hidden link you'll notice that I managed to add a delete relationship link.

It seems that when editing the template for your View output using Blocks, the Form block doesn't yet support inserting such links. You can insert a Classic block and then use the traditional Toolset Forms button (although it's an icon), which shows a more complete list of options, although the delete relationship link is still missing, and this appears to be connected to designing the template with blocks, and when editing the template directly (not with blocks) that link should be available. (I'm going to discuss with the developers about what is currently supported/expected.)

In the meantime, I inserted the link directly in the Loop Editor, where the Toolset Forms button did offer to create the link.

As an aside, you've set up your View to use a one column Bootstrap grid, which is a bit meaningless, you could likely have just selected unformatted for the output format, which would have involved simpler markup.

Turning to the link to edit existing relationships, here I ran into problems.

Following the documentation (https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/editing-existing-connections-between-related-posts/) I was able to create such a link without problem on my own test site, but on your site I couldn't.

I tried editing what you'd already done, and I tried starting from scratch with my own forms and templates, and kept running into the problem that the required option was always greyed-out (screenshot).

I spent well over an hour trying that, and I've had to ask a colleague to take a look as I need to move on.

So I'm escalating this while waiting for feedback from my colleagues. They have access to your site.

I'll get back to you.

#1482653

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

So it seems that we are trying to do something here that is not possible.

Edit relationship forms only work where there are relationship fields (i.e. there is an intermediate post type which stores custom fields).

Without those, there is nothing to "edit".

"Editing" does not mean swapping one of the existing related posts for a different related post.

To do that, you must first delete the existing connection, and then create a new one with the required connection.

I had it "working" on my test site because the relationship happened to have relationship fields.

#1482751

Thx Nigel for the great help! I am somewhat relieved that it wasn't all my fault/ignorance but that it's actually not possible at the moment 🙂

Nevertheless: so are you saying, if I add a custom field to the relationship then I can edit?

So a solution would be that I add a custom field that somehow makes sense?

Cheers
T

#1482919

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

That should be the case.

Edit the relationship so that it includes a relationship field (possibly a dummy one) and make sure your relationship form includes the relationship field (maybe hidden by CSS), and then it should be possible to insert the edit relationship links.

With one proviso, namely that the output of your View, you are editing the template with Blocks, in which case the edit link seems to be missing, even if you use a Classic block to insert the link with Toolset Forms rather than the Forms block.

It should appear if you insert it directly in the output section of the View, i.e. the Loop Editor, where I inserted the delete relationship link.

#1487903

Thanks Nigel for the investigative report, I will try this. My issue is resolved now. Thank you!