twill icon indicating copy to clipboard operation
twill copied to clipboard

Multiple browser inputs for a single module

Open wratke opened this issue 8 years ago • 2 comments

Does the name for a browser input need to match the module name? I would like to have three separate browser inputs that all use a single module, but when I gave each input a unique name, nothing was saved. Changing the name to match the module name allows me to save them, but that prevents me from having three separate inputs with different items from the module for each one. Is there a way around this? Or in this instance would I need to create three separate tables in the database, one for each input?

wratke avatar Oct 30 '18 16:10 wratke

The default behavior would be to use 3 different relationships in your module, with 3 tables, yes.

Laravel allows you to apply scope to relationship definitions though, so you should able to store everything in the same table for those 3 relationships, but with an additional pivot field indicating in which browser it is saved. This will requires some custom logic when saving in afterSave, but it shouldn't be too complicated. Happy to help if you can share a demo codebase!

ifox avatar Oct 30 '18 17:10 ifox

That issue has never been resolved, still happening for Twill v 2.12

power-media avatar Feb 06 '23 19:02 power-media