Can anyone provide an example of how to create a channel. I’ve tried basing my code on the example in the docs, but it just tells me an error has occured. If I could see the error it might help, but am too much of a newbie to know how to display it!
$this->EE->load->library('api');
$this->EE->api->instantiate('channel_structure');
$data = array( 'channel_title' => 'test', 'channel_name' => 'test');
if ($this->EE->api_channel_structure->create_channel($data) === FALSE) { show_error('An Error Occurred Creating the Channel <pre>' . '</pre>
<p>'); }I’ve stripped the call down to the bare minimum to try and find out what I’m doing wrong, but to no avail.
Any clues would be most welcome!
Andrew
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.