MODx - How to create MIGX inside another MIGX?

737 Views Asked by At

Good day! To my regret I can not create migx inside another migx. Below is the code that I use. mainTV (slider):

[
{"caption":"Info", "fields": [
    {"field":"slider_title","caption":"Header row","inputTV":"slider_title_row"},
    {"field":"image","caption":"Image","inputTV":"image_helper"}
]}
]

subTV (slider_title_row):

[
   {"caption":"Header row", "fields": [
    {"field":"title_row","caption":"Header row","inputTVtype":"text"}
   ]}
]

main call:

<div class="main-carousel">
    [[!getImageList? &tvname=`slider` &tpl=`Slider_title.tpl`]]
</div>

chank Slider_title.tpl:

<div class="main-carousel__item carousel-item" style="background-image:url([[+image]]);">
  <div class="container">
    <div class="carousel-item__description">
      <h2>[[!getImageList?
            &tpl=`Slider_title_row.tpl`
            &value=`[[+slider_title]]`
           ]]
      </h2>
    </div>
  </div>
</div>

chank Slider_title_row.tpl:

<div>[[+title_row]]</div>

I can not understand what I'm doing wrong?? Thank you in advance.

1

There are 1 best solutions below

0
On

From what I can see, the issue seems to be from the use of &tvname on the outer migx call.

Swap this to be similar to what you have for the inner one, and it should work just fine.

<div class="main-carousel">
    [[!getImageList? &value=`[[*slider]]` &tpl=`Slider_title.tpl`]]
</div>