I inherited a simple DB to be now managed with MIGXdb.
One row equals one item.
Each item has a field that contains multiple image paths, comma separated. (eg: path/to/img1,jpg,path/to/img2.jpg,path/to/img3.jpg)
So far so good. Now I need to somehow “explode” these CSVs into multiple image input types in migxdb’s CMP, so that the csv items can be managed using file- or image-selector input types. (similiar to listbox-multiple)
MIGX has never let me down so far but I can’t seem to figure out how to make this happen.
Anyhow there must be a better way than exploding the field content into multiple fields (image1, image2, image3) only to be able to make it backend manageable.
Any ideas? Am I missing something obvious?
PS: I could change the commas to “||” if that helps.
Yes. In the MIGX configuration for you database table use “Input TV type” = migx for the column with the images and set “Configs” to the name of another MIGX-configuration.
In this second configuration create a field with “Input TV type” = image and a “Fieldname” like (for example) img_path.
Then make sure that the JSON-values in the DB-column have a structure like this:
Yay - thanks a lot. That was just what I needed and I’m almost there.
using a JSON array’d example in the DB and and a new MIGX tv productImages I now see and (almost) edit the images in a MIGXdb widget. I suspected but wasn’t aware you could go this far in MIGXdb.
So I entered productImages into Input TV and “migx” into Input TV type and I’m one step further.
It seems to pick up the grid column(s) from productImages but not the form tabs.
When I right click and edit a row it just presents me one default textfield titled “Title”. Saving (the text) works fine though.
let Input TV empty. Only use input TV type and do all your configuration for formtabs and columns in a MIGX configuration (within the MIGX CMP).
You don’t need a actual MIGX TV for that.