K
K
KirSupi2020-10-20 23:28:31
MODX
KirSupi, 2020-10-20 23:28:31

How to nest migx in migx?

How to make nested migx?
The data should end up looking something like this:

data = {
    "id1" : {
        "title": "Title One",
        "elems": [
            "elem1Name": "elem1Data",
            "elem2Name": "elem2Data",
            "elem3Name": "elem3Data"
        ]
    },
    "id2" : {
        "title": "Title Two",
        "elems": [
            "2elem1Name": "2elem1Data",
            "2elem2Name": "2elem2Data",
            "2elem3Name": "2elem3Data"
        ]
    }
}

from this you need to generate something like this html:
<div id="id1">
    <h1>Title One</h1>
    <div id="elem1Name">elem1Data</div>
    <div id="elem2Name">elem2Data</div>
    <div id="elem3Name">elem3Data</div>
</div>
<div id="id2">
    <h1>Title Two</h1>
    <div id="2elem1Name">2elem1Data</div>
    <div id="2elem2Name">2elem2Data</div>
    <div id="2elem3Name">2elem3Data</div>
</div>

Accordingly, it is necessary that the content manager can edit it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor, 2020-10-29
@ig0r74

https://www.youtube.com/watch?v=_CFCr_embNw

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question