I’m trying to output content to a custom XML file and I need to filter the content one more time but I’m not sure how to do this.
I have an array of strings like this:
<practices>bf82cb61||f82e0c12||328d7ce8c</practices>
Each of these tv selections corelate to a resource with the same link_attribute and a snippet is in place to generate their names from the resource’s pagetitle.
<?php
$output = '';
$parts = explode("||", $input);
foreach($parts as $serviceId){
$where = array(
'link_attributes' => $serviceId,
'template:IN' => [10,20]
);
$item = $modx->getObject('modResource', $where);
if(($item)){
$res = $item->toArray();
$pagetitle = htmlentities($res['pagetitle']);
$output .= '<serviceIndustry>' . $pagetitle . ' </serviceIndustry>';
}
}
return $output;
I need to filter these results by an additional radio TV within each resource. Each resourse can be either a service, an industry or a landing page. I need to only include services & industries.
Any ideas?
Thanks