Answer the question
In order to leave comments, you need to log in
How to display only parents of resources through pdoTools and is it possible?
Answer the question
In order to leave comments, you need to log in
I had to write a snippet, maybe someone needs it:
<?php
//
if(!empty($resources)){
$resources = explode(",",$resources);
$arr = [];
foreach($resources as $id){
$parentIds = $modx->getParentIds($id, 10, array('context' => 'web'));
$arr[] = $parentIds[0];
}
$arr = array_unique($arr);
$arr = implode(",",$arr);
return $arr;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question