Answer the question
In order to leave comments, you need to log in
How to change the sorting in modx, so that it would not be displayed by id, but there ass, desk?
How to change the sorting in modx, so that it would not be displayed by id but ass, desk ?
I correctly understand that sorting is added here?
/** @var pdoFetch $pdo */
$pdo = $modx->getService('pdoFetch');
$list = $pdo->getCollection('modResource', '', [
'parents' => $parent,
'limit' => 100,
'includeTVs' => 'tagCategory,tagOption',
'tvFilters' => 'tagCategory=='.$modx->resource->id,
]);
if (!$list) {
return '';
}
$tags = [];
foreach ($list as $v) {
list($key, $value) = explode('|', $v['tagOption'], 2);
$tags[] = [
'key' => $key,
'name' => $value,
'title' => $v['longtitle'] ?: $v['pagetitle'],
'uri' => $v['uri'],
];
}
/** @var pdoTools $pdoTools */
$pdoTools = $modx->getService('pdoTools');
return $pdoTools->getChunk($tpl, [
'tags' => $tags,
]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question