0

I have a "Teams" channel that has a relationship field to a "tournaments" channel. On the frontend when I display all the teams for that tournament, I need to allow a user to remove their team from that tournament. How do I go about doing this? I still want to keep the team entry, just clear that relationship field so they aren't attached to a tournament anymore. Not sure if there are meta data and all that you have to set.

3
  • You need to use channel forms in the front-end where logged in user can edit their entry data.
    – Jainil
    May 8, 2017 at 14:21
  • I've been playing around with the channel form and trying to spit out the relationship field. It seems to spit out a select box with all the tournaments if I use {field:relationship_field}. How would they "deselect" their tournament from dropdown? Not sure why it doesn't spit out the relationship selector from the CMS with a little search box they can use.
    – Chief
    May 8, 2017 at 20:12
  • I have the CSS linked in the <head> based off docs <link href="{path='css/_ee_channel_form_css'}" type="text/css" rel="stylesheet" media="screen"> not sure if there's an actual css file that should be sitting in my /css called "_ee_channel_form_css" or if that's a path that gets generated automatically from the EE install
    – Chief
    May 8, 2017 at 20:15

1 Answer 1

1

You can use external entries plugin like as below:

{exp:external_entries:delete table="exp_relationships" 
search:parent_id="{segment_1}" AND search:child_id="{segment_2}"  debug="no"}

Plugin is not available for EE3 but it will still work in EE3 just need to add the addon.setup.php file.

2
  • what do you mean just have to add the addon.setup.php file? what's that consist of and how do I do this? why haven't they updated it to EE3 compatible if it's that easy?
    – Chief
    May 8, 2017 at 20:06
  • addon.setup.php file is required for the EE3 addons.This file provides descriptive data about a specific add-on such as author, name, and version.
    – Jainil
    May 10, 2017 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.