<div class="slider">
<div data-am-fadeshow="next-prev-navigation">
<!-- Radio -->
[[getImageList? &tvname=`slider` &tpl=`tpl.slider.input.row`]]
<!-- Slides -->
<div class="fs-slides">
[[getImageList? &tvname=`slider` &tpl=`tplsliderItem`]]
</div>
.... и далее по тексту
<input type="radio" name="css-fadeshow" id="slide-[[+idx]]" />
{set $slider = $_modx->resource.slider | json_decode : true}
{set $idx = 1}
<!-- Radio -->
{foreach $slider as $slide}
<input type="radio" name="css-fadeshow" id="slide-{++$idx}" />
{/foreach}
<div class="fs-slides">
{foreach $slider as $slide}
...код слайда
{/foreach}
</div>
$order_id = 1; // ID Заказа
/** Вот так получить список всех товаров конкретного заказа: **/
$q = $modx->prepare("SELECT * FROM ".$modx->getOption('table_prefix')."ms2_order_products WHERE order_id=".$order_id);
$q->execute();
$results = $q->fetchAll(PDO::FETCH_ASSOC);
/** Вот так получить сам заказ: **/
$order = $modx->getObject('msOrder', $order_id)->toArray();
// Список чанков оформляется в массив
$chunks = [
'lib.block.profile.7',
'lib.block.profile.3',
];
if ($modx->resource->id==54) {
$output = $chunks[1]; // Не знаю, нужно ли вам это условие
} else {
// Но если оно не выполняется, в $output кладется случайное значение чанка из массива
$output = $chunks[rand(0, count($chunks) - 1)];
}
// Возвращается обработанный чанк
return $modx->getChunk($output);
$count = 0;
$pdo = $modx->getService('pdoFetch');
$resources = $pdo->getCollection('modResource', array('parent' => 10), array('includeTVs' => 'num'));
foreach ($resources as $res) {
$count = $count + $res['num']
}
return $count;
{set $products = '!pdoResources' | snippet : [
'return' => 'json',
....
] | json_decode : true}
{foreach $products as $product}
...
{/foreach}
&customPackages=`quipComment:body:quip:{core_path}components/quip/model/:quipComment.resource = modResource.id`
Let's break down each part:
className - The class name of the table you want to search. Here, it's QuipComment.
fieldName(s) - A comma-separated list of column names to search. We did 'body', you could also have done 'body,email' or whatever.
packageName - The name of the schema Package to add. This one is called quip.
packagePath - The path to the model/ directory where the package is located.
joinCriteria - The SQL to join the table you want to search and the modResource table. Your table must have some connection to the Resource it's on (otherwise SimpleSearch won't know how to load a URL for it!)