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 :)

  • 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). – Romans-8---31-39 Mar 19 '15 at 18:41
  • Oh snap, came to the same solution whilst dreaming. Throw it up as an answer and reap the rewards – stuartmcd69 Mar 20 '15 at 7:35
  • Sweet. And by rewards, I'm hoping you mean donuts? – Romans-8---31-39 Mar 20 '15 at 13:24
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).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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