In order to make it more comfortable to the editor: is it possible to "style" the MIGX table in the backend in a way so it better reflects the design of the website? If the editor uses h1, h2 or a table tag, the styles of the MODX backend are shown in the MIGX backend... it’s a little bit confusing then.
<?php
//[[mergeMIGX? &tvname=`mymigxtv` &docids=`10,11,12` &tpl=`mytpl`]]
$docids = explode(',', $docids);
if ($tv = $modx->getObject('modTemplateVar', array('name' => $tvname))) {
foreach ($docids as $docid) {
$outputvalue = $tv->renderOutput($docid);
$items = $modx->fromJSON($outputvalue);
$allitems = array_merge($allitems, $items);
}
$scriptProperties['value'] = $modx->toJSON($allitems);
}
return $modx->runSnippet('getImageList',$scriptProperties);
?>
<?php
$docids = explode(',', $docids);
if ($tv = $modx->getObject('modTemplateVar', array('name' => $tvname))) {
foreach ($docids as $docid) {
$outputvalue = $tv->renderOutput($docid);
$items = $modx->fromJSON($outputvalue);
$allitems = array_merge((array)$allitems, (array)$items);
}
}
$scriptProperties['value'] = $modx->toJSON($allitems);
return $modx->runSnippet('getImageList',$scriptProperties);
?>
$allitems = array_merge((array)$allitems, (array)$items);
(ERROR @ /home/content/49/8083049/html/core/cache/includes/elements/modsnippet/41.include.cache.php : 15) PHP warning: array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array
http://php.net/manual/en/function.array-merge.php
The behavior of array_merge() was modified in PHP 5. Unlike PHP 4, array_merge() now only accepts parameters of type array.
core/cache/includes/elements/modsnippet/53.include.cache.php : 324) PHP warning: implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed
includes/elements/modsnippet/57.include.cache.php 16) PHP warning: array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #1 is not an array
[[!mergeMigx?
&tvname=`commercialRubric`
&docid=`42`
&tpl=`commercialRubricOutputInner`
&where=`{"publishPage:=":"[[*id]]"}`
&limit=`10`
]]Fatal error: Call to a member function fetchTemplate() on a non-object in /core/model/modx/processors/element/tv/renders/mgr/input/text.php on line 8
[
{"caption":"Info", "fields": [
{"field":"title","caption":"Title","description":"Title for the image."},
{"field":"description","caption":"Description","inputTV":"richtext"}
]},
{"caption":"Image", "fields":[
{"field":"image","caption":"Image","inputTV":"image"}
]}
] [
{"header": "Title", "width": "160", "sortable": "true", "dataIndex": "title"},
{"header": "Image", "width": "50", "sortable": "false", "dataIndex": "image","renderer": "this.renderImage"}
][[*productDoc:!empty=` <h2>Title</h2> <ul class="file-list"> [[getImageList? &tvname=`productDoc` &tpl=`productDoc`]] </ul>`]]
This discussion is closed to further replies. Keep calm and carry on.