1

I'm looking to set up a situation where a user can visit an entry and create a related entry. The original entry will be the parent, the new entry the child.

The issue is the 'related' entry needs to add itself to the parents entry (playa list), so I'll likely need to create a module or something.

The part that has me flummoxed is simply adding the properly formatted inputs to the Channel Data via mySQL etc does not update the playa field & doesn't work.

Yet, if I open up a channel form (parent entry) and add some hidden inputs – when saved, it correctly updates its playa content. So it's only when saving (Channel form) that both the Channel Data and Playa content gets updated.

Imagine this:

  • User visits entryA & clicks 'create related entry'
  • url = /create/{entry_id} <- Parent entry ID
  • Saves channel form (No playa data)
  • After it's saved, fire off some 'magic' so it triggers the update to the Parent Entries (entryA) channel data field and also fires an update to the exp_playa table as well - I almost need like an invisible channel form to fire.

If you're still reading: I need some guidance on how to achieve something resembling this and everyone gets a cookie :)

3
  • What about flipping it and making the relationship field on the child entry? Then you could add the parent entry to that newly created child by grabbing it from the segment and using hidden playa input(s). Commented Mar 19, 2015 at 18:41
  • Oh snap, came to the same solution whilst dreaming. Throw it up as an answer and reap the rewards Commented Mar 20, 2015 at 7:35
  • Sweet. And by rewards, I'm hoping you mean donuts? Commented Mar 20, 2015 at 13:24

1 Answer 1

0

Flipping your example around, you can make the relationship field on the child entry. Then add the parent entry to that newly created child by grabbing it from the segment and using hidden playa input(s).

Your Answer

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

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