Мультизагрузка изображений в админке MODX Revolution при помощи MIGX
[[migxResourceMediaPath? &pathTpl=`assets/resourceimages/{id}/` &createFolder=`1`]]
{
"formtabs":[
{
"MIGX_id":71,
"caption":"Image",
"print_before_tabs":"0",
"fields":[
{
"field":"title",
"caption":"Title",
"MIGX_id":327,
"pos":1
},
{
"MIGX_id":329,
"field":"description",
"caption":"Description",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"",
"validation":"",
"configs":"",
"restrictive_condition":"",
"display":"",
"sourceFrom":"config",
"sources":"",
"inputOptionValues":"",
"default":"test",
"useDefaultIfEmpty":"0",
"pos":2
},
{
"MIGX_id":330,
"field":"showBtn",
"caption":"Show button",
"description":{
"field":"showBtn",
"caption":"Show button",
"inputTV":"showBtn"
},
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"checkbox",
"validation":"",
"configs":"",
"restrictive_condition":"",
"display":"",
"sourceFrom":"config",
"sources":"",
"inputOptionValues":"yes==yes",
"default":"yes",
"useDefaultIfEmpty":1,
"pos":3
},
{
"MIGX_id":425,
"field":"image",
"caption":"Image",
"description":"",
"description_is_code":"0",
"inputTV":"",
"inputTVtype":"image",
"validation":"",
"configs":"",
"restrictive_condition":"",
"display":"none",
"sourceFrom":"migx",
"sources":"",
"inputOptionValues":"",
"default":"",
"useDefaultIfEmpty":"0",
"pos":4
}
],
"pos":1
}
],
"contextmenus":"edit_migx||duplicate_migx||remove_migx_and_image||movetotop_migx||movetotop_bottom",
"actionbuttons":"loadfromsource||uploadfiles",
"columnbuttons":"",
"filters":"",
"extended":{
"migx_add":"Add Image",
"disable_add_item":1,
"add_items_directly":"",
"formcaption":"Image",
"update_win_title":"",
"win_id":"resourcegallery",
"maxRecords":"",
"addNewItemAt":"bottom",
"multiple_formtabs":"",
"multiple_formtabs_label":"",
"multiple_formtabs_field":"",
"multiple_formtabs_optionstext":"",
"multiple_formtabs_optionsvalue":"",
"actionbuttonsperrow":4,
"winbuttonslist":"",
"extrahandlers":"this.handleColumnSwitch",
"filtersperrow":4,
"packageName":"",
"classname":"",
"task":"",
"getlistsort":"",
"getlistsortdir":"",
"sortconfig":"",
"gridpagesize":"",
"use_custom_prefix":"0",
"prefix":"",
"grid":"",
"gridload_mode":1,
"check_resid":1,
"check_resid_TV":"",
"join_alias":"",
"has_jointable":"yes",
"getlistwhere":"",
"joins":"",
"hooksnippets":"",
"cmpmaincaption":"",
"cmptabcaption":"",
"cmptabdescription":"",
"cmptabcontroller":"",
"winbuttons":"",
"onsubmitsuccess":"",
"submitparams":""
},
"columns":[
{
"MIGX_id":1,
"header":"ID",
"dataIndex":"MIGX_id",
"width":10,
"renderer":"",
"sortable":"false",
"show_in_grid":1
},
{
"MIGX_id":2,
"header":"Title",
"dataIndex":"title",
"width":20,
"sortable":"false",
"show_in_grid":1,
"renderer":"",
"clickaction":"",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":"",
"editor":"this.textEditor"
},
{
"MIGX_id":3,
"header":"Image",
"dataIndex":"image",
"width":20,
"renderer":"this.renderImage",
"sortable":"false",
"show_in_grid":1
},
{
"MIGX_id":4,
"header":"Published",
"dataIndex":"published",
"width":"",
"sortable":"false",
"show_in_grid":1,
"renderer":"this.renderSwitchStatusOptions",
"clickaction":"switchOption",
"selectorconfig":"",
"renderchunktpl":"",
"renderoptions":[
{
"MIGX_id":1,
"name":"published",
"use_as_fallback":1,
"value":1,
"clickaction":"switchOption",
"handler":"",
"image":"assets\/components\/migx\/style\/images\/cb_ticked.png"
},
{
"MIGX_id":2,
"name":"published",
"use_as_fallback":"",
"value":1,
"clickaction":"switchOption",
"handler":"",
"image":"assets\/components\/migx\/style\/images\/cb_ticked.png"
},
{
"MIGX_id":3,
"name":"unpublished",
"use_as_fallback":"",
"value":"0",
"clickaction":"switchOption",
"handler":"",
"image":"assets\/components\/migx\/style\/images\/cb_empty.png"
}
],
"editor":""
}
]
}[[getImageList?
&tvname=`resourcealbum`
&tpl=`@CODE:<h3>[[+title]]</h3><img src="[[+image]]" />`
&where=`{"published":"1"}`
]]Либо используйте внешний чанк, если предполагается обработка изображений при помощи phpthumb или что-то типа того:[[getImageList?
&tvname=`resourcealbum`
&tpl=`imageTpl`
&where=`{"published":"1"}`
]]
