Page 1 of 1

CGBlog UDT get Child categories / ECB

Posted: Wed Aug 19, 2015 9:14 am
by naturelab
I have a UDT that returns an array of CGblog categories. This is then used to populate an ECB multiselect dropdown.

UDT - name = "categories"

Code: Select all

cms_utils::get_module('CGBlog');
$blogcategories = cgblog_ops::get_category_list(FALSE,null,FALSE);
$catarray = array_combine($blogcategories, $blogcategories);
return $catarray;
I then use the ECB module to populate a multiselect dropdown.

Code: Select all

{content_module module="ECB" field="dropdown_from_udt" block="tagselect" label="Select tags" udt='categories'  size="50" multiple="true" assign='tagselect' tab='Tags'}
This works well, ( although there is a separate issue with the ECB multiselect, it does not retain the highlight selection when you go back to the page ).

What I would like to do, is make a similar UDT but to ONLY pull out CHILDREN of a specific catgeories.


ie:-
1) Get CGBlog categories
2) Find specific category
3) Return array of ONLY the children of this specific category

Code: Select all

$blogcategories
looks something like this...
[id] => 85
[name] => blah
[parent_id] => -1 [item_order] => 87
[hierarchy] => 00087
[long_name] => blah
[description] =>
[depth] => 1


Any help greatly appreciated

Thankyou