I have been using the Cobalt API and am stuck.
I have used the API to return specific records. These records have a child field and have many children. How can I filter these children results?
Here is the code I am using to get the array of records.
$areas = $api->records(
$section_id = 4, //ID of Directory
$orderby='r.title ASC',
$limit=1000,
$ids = $record_list //my array of values
);
Each item in this array has children(using the relationships field). I want to sort through each list of children and only display certain results. I've tried using
foreach($areas['list'] AS $item) {
echo CobaltApi::renderField($item, '25', 'list'); //25 is field ID of child field.
}
This shows me all of the children, but this doesn't allow me to filter the results.
I hope this is clear, any help is very appreciated.
I have been using the Cobalt API and am stuck.
I have used the API to return specific records. These records have a child field and have many children. How can I filter these children results?
Here is the code I am using to get the array of records.
Each item in this array has children(using the relationships field). I want to sort through each list of children and only display certain results. I've tried using
This shows me all of the children, but this doesn't allow me to filter the results.
I hope this is clear, any help is very appreciated.