Looping over a nested list group[] parameter

Hi there

How do I loop over a nested group[] parameter?

Working code:

{
“listItems”: {
“type”: “group[]”,
“label”: “List Items”,
“itemLabel”: “{{index}}. {{platform}}”,
“params”: {
“platform”: {
“type”: “text”,
“label”: “Name”,
“placeholder”: “ex: Windows”
},
“icon”: {
“type”: “image”,
“label”: “Icon”
},
“features”: {
“type”: “group[]”,
“label”: “Features”,
“itemLabel”: “{{index}}. {{feature}}”,
“params”: {
“feature”: {
“type”: “text”,
“label”: “Name”,
},
“description”: {
“type”: “text”,
“label”: “Description”,
}
}}}}}

In this case I have set up a looper provider for {{dc:params:listItems}} and would like to set up another looper provider inside that one that loops over the features list.

Any ideas? :slight_smile:

Thanks.

Hello @MathiasD,

Thanks for writing to us.

In order to use multiple loopers I would suggest you please have a look at these videos to learn more about how to use the multiple loopers.

Hope it helps
Thanks

Hmm, I dont’t see that the video covers nested looper providers from the group[] parameter? :thinking:

Hey @MathiasD,

Sorry for the confusion. Checking your JSON here, it is not valid or there is an error.

The use of array in the JSON Looper is mentioned in our Super Looper course in which you can watch if you’re subscribed to Max. We cannot include the lesson as part of forum support.

Thank you for understanding.

@christian Hi Christian,

I have corrected the Parameter JSON but are still having trouple creating that looper provider over the nested features group[] :sweat_smile:

Correct Parameter JSON:

{
    "content": {
        "type": "group[]",
        "label": "List Items",
        "itemLabel": "{{index}}. {{platform}}",
        "params": {
            "platform": {
                "type": "text",
                "label": "Name",
                "placeholder": "ex: Windows"
            },
            "icon": {
                "type": "image",
                "label": "Icon"
            },
            "features": {
                "type": "group[]",
                "label": "Features",
                "itemLabel": "{{index}}. {{feature}}",
                "params": {
                    "feature": {
                        "type": "text",
                        "label": "Name",
                        "placeholder": "Ex: Cool feature"
                    },
                    "description": {
                        "type": "text",
                        "label": "Description",
                        "placeholder": "Ex: One piece of cool feature!"
                    }
                }
            }
        }
    }
}

I have a looper provider over the {{dc:param:content}} which works fine. I have then tried creating a looper provider inside the first one but cannot target the features group[].

How about I subscribe to One? Will that make if possible for you to help here? :slightly_smiling_face:

Hi Mathias,

You can avail of the One service, where we answer your questions beyond normal theme support. But if you need small customization, you can avail of TOTAL CARE.

Thanks

Hi @tristup

Ok. I have now the following looper providers:

#1: Dynamic Content: {{dc:param:content}}
#2: Dynamic Content: tried both {{dc:param:features}} and {{dc:looper:field key=“features”}} and {{dc:param:features}} and array=features

I then have a headline consumer: {{dc:looper:field key=“feature”}}

Since nothing comes up in the consumer, what am I missing here? :thinking:

Hey @MathiasD,

Your question is related to your JSON looper. We can check it out in our One Single Platform service. If you need implementation, that’s where our One Total Care comes in.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.