We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

category_tree() API problem

Development and Programming

timoteus's avatar
timoteus
25 posts
15 years ago
timoteus's avatar timoteus

Hi,

When working on a custom fieldtype, I instantiate the channel_categories API as Greg supposed in http://ellislab.com/forums/viewthread/171765/:

$this->EE->load->library('api');
$this->EE->api->instantiate('channel_categories');

$group_id = '2';
$the_cats = $this->EE->api_channel_categories->category_tree($group_id);

The Problem: no matter what group_id I set, I always get an array of all categories from all category groups. I’ve tried to use an array for selecting the category group:

$group_id[] = '2';
$the_cats = $this->EE->api_channel_categories->category_tree($group_id);

an empty array is returned.

Anybody else experienced problems using the channel_categories API?

I’m using EE 2.1.1 build 20101020

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.