This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

chris10207
chris10207

Hi, having the same requirements. here some of my research feedback:

  • if you are not using a pivot form, you can use a jsonable field with the datatable type, it works perfectly without effort. it allows to create set of customs attributes with their corresponding value, but does not work in pivot form, not sure why yet

  • write your own formwidget that will transform a json field fron the database into several input field on the form: im currently looking into this direction, but have no clue where to start since im stucked with a pivot form.

  • in the catalog plugin, there is another solution based on 2 or 3 relationships and tables, quite nice solution if you dont have too many objects- in my case i have potentially 20 000 main object that can be associated up to 5 amongst 1000 others objects.

my 2 cents

chris10207
chris10207

the solution might be here actually with this dynamicmodel implementation https://gist.github.com/daftspunk/22ea758ce864ef1d7127

chris10207
chris10207

Hi you're very welcome ! i found a better solution implemented trough a modelbehavior, this is fantastic and replied to my requirements. The only thing i need to build on top of that in my case is the dynamic display of the required fields based on a config description (stored into json format). Not sure yet where to do this, i would say inside the controller or in the plugin.php file.

Anyway, here is the code i found https://gist.github.com/ternavsky/1156d32e64eaed55f190

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.