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

Using EE APIs to add category...

Development and Programming

Jaaahn's avatar
Jaaahn
4 posts
15 years ago
Jaaahn's avatar Jaaahn

Hi,

I am wondering if there is an API for adding Categories or if this is something that has to be done manually using the database class? I have looked through the site and not found anything, have i missed something?

Cheers.

       
MaxStoun's avatar
MaxStoun
21 posts
15 years ago
MaxStoun's avatar MaxStoun

Try to create own function with code like

$category_data = array(
    'group_id' => $this->input->post('group_id'),
    'cat_name'  => $this->input->post('cat_name'),
    'cat_url_title' => $this->input->post('cat_url_title'),
    'cat_description' => $this->input->post('cat_description'),
    'cat_image' => $this->input->post('cat_image'),
    'parent_id' => $this->input->post('parent_id'),
    'cat_order' => $this->input->post('cat_order'),
    'site_id' => $this->input->post('site_id')
);
$this->db->insert('categories', $category_data);

This code from admin_content.php, function category_update() (I don’t test this code “stand-alone”) I think that no such function in the API

       

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.