MODx - 如何在另一个MIGX中创建MIGX?

时间:2017-07-22 07:26:12

标签: modx modx-revolution modx-chunks migx

美好的一天! 遗憾的是,我不能在另一个migx中创建migx。 下面是我使用的代码。 mainTV(滑块):

[
{"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"}
   ]}
]

主要电话:

<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>

我无法理解我做错了什么? 提前谢谢。

1 个答案:

答案 0 :(得分:0)

从我所看到的,问题似乎来自在外部migx调用上使用 function populateUsersGrid() { var grid = $("#users_grid").jsGrid({ height: "auto", width: "100%", autoload: true, sorting: true, editing: true, selecting: false, noDataContent: "", deleteConfirm: function (item) { return "The User, \"" + item.first_name + ' ' + item.last_name + "\" , will be removed from the Users table. Are you sure?"; }, controller: { loadData: function () { var d = $.Deferred(); $.post("assets/php/get_users.php", {}, function (data) { d.resolve(data); }); return d.promise(); } , updateItem: function(item) { return $.ajax({ type: "POST", url: "assets/php/update_user.php", data: { 'user_id': item.id, 'role_id': item.role_id }, success: function (data) { $("#users_grid").jsGrid("render"); } }); }, deleteItem: function(item) { return $.ajax({ type: "POST", url: "assets/php/delete_user.php", data: { 'user_id': item.id }, success: function (data) { $("#users_grid").jsGrid("render"); } }); } }, fields: [ { title: "Last Name", name: "last_name", editing: false, type: "text", align: "left", width: "20%" }, { title: "First Name", name: "first_name", editing: false, type: "text", align: "left", width: "20%" }, { title: "Email Address", name: "email", editing: false, type: "text", align: "left", width: "30%" }, { title: "Role", name: "role_name", type: "text", align: "left", width: "20%" }, { type: "control" } ] }); }

将其交换为与内部类似的内容,它应该可以正常工作。

&tvname