MIGX nestead loop

inputTVtype:migx is working fine here. But subfields are not working.
Am I doing right?

[{
"fields": [
  {
    "field": "type",
    "caption": "Work Type"
  },
  {
    "field": "carousel",
    "caption": "Word Carousel",
    "inputTVtype": "migx",
    "configs": {
      [{
        "fields": [
          {
            "field": "image",
            "caption": "Image",
            "inputTVtype": "image"
          },
          {
            "field": "name",
            "caption": "Name"
          }
        ]
      }]
    }
  }
]
}]

I don’t know if you can nest configs directly in JSON. Personally I always use the GUI instead of writting the JSON configuration by hand.

In the manager menu, go to “Extras” → “MIGX”. Add a new config in the tab “MIGX”. Then use the ‘name’ of this new config in “configs”-field of the wrapper configuration.

I watched your video on MIGXdb but that is hard for me to understand.
Can I use MIGX only? Actually, I never have used GUI. I always write JSON code.

Yes, you don’t have to create database tables to make it work.

For the migx inputTVtype, I have two fileds named “name” and “work_carousel”.
For the field “work_carousel” I used inputTVtype “migx”, but how can I add field for this “work_carousel”?

Although the “work_carousel” field has config fields. I wrote JSON code there but not showing up.

Output:

In the field “Configs” you write the name of the nested MIGX-config and not the JSON-data.


You either create 2 MIGX configs. 1 for the wrapper MIGX and 1 for the nested MIGX. Then in the wrapper MIGX-config → field ‘work_carousel’ → input field “Configs” → you put the name of the other MIGX-config.

Or you create only one MIGX config for the nested MIGX. And then use "configs": "name_of_nested_migx_config" in your JSON (in the field “Form Tabs” when creating the TV.)

I have been trying to make a migx field for the last two hours. But it’s loading.
Sometimes one popup shows up but another one doesn’t.
Even, the manager page takes a long time to load. I have restarted my PC a couple of times.

Can you find me a solution?

Is this a local MODX installation on your PC? I’ve experienced some slowing down when the xDebug extension (a PHP debugger) is running.


If this doesn’t work at all with the configs in the MIGX CMP, you could also create a second TV (of type ‘migx’).

And then use

{
	"field": "carousel",
	"caption": "Word Carousel",
	"inputTV": "nested_migx_tv"
}

in your wrapper-migx-TV instead of

{
    "field": "carousel",
    "caption": "Word Carousel",
    "inputTVtype": "migx",
    "configs": "nested_migx_config_name"
}

No, my site is hosted in https://www.hetzner.com/


Still not working, I guess I am wrong

In your Parent migx TV, use "inputTV": "work_carousel_tvs". You are now using an actual TV. So you don’t have to define the "inputTVtype" anymore. That is defined by the actual TV “work_carousel_tvs”. You also don’t need "configs", because the configuration is directly defined in the TV “work_carousel_tvs”.


In your Child migx TV, remove “inputTV”. (Don’t reference the parent in the child.)

This is awesome. All credit goes to you.

But I can’t display the output.

[[getImageList? &tvname=`works_type` &tpl=`@CODE:

    [[getImageList? &tvname=`work_carousel` &tpl=`@CODE:
       [[+image]]
    `]]

`]]

better create a tpl chunk and put

    [[getImageList? &value=`[[+carousel]]` &tpl=`@CODE:[[+image]]`]]

in it

[[getImageList? &tvname=`works_type` &tpl=`@CODE:
   [[getImageList? &value=`[[+work_carousel]]` &tpl=`work_carousel_tpl`]]
`]]

When I use this code my site shows HTTP ERROR 500

Please notice this, how I registered field/tv

Use a real chunk (instead of @CODE:) for the outer call to “getImageList”

[[getImageList? &tvname=`works_type` &tpl=`an_actual_chunk`]]

Then in the chunk “an_actual_chunk” put another “getImageList” tag and use the &value property instead of &tvname.
(The data is not actually stored in the TV “work_carousel”. It’s stored as the field “carousel” in the TV “works_type”)

[[+type]] ...
[[getImageList? &value=`[[+carousel]]` &tpl=`@CODE:[[+image]]`]]

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.