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

Automatically create a channel using a module?

Development and Programming

Jayson Ng's avatar
Jayson Ng
67 posts
15 years ago
Jayson Ng's avatar Jayson Ng

how do I automatically create a channel (or Controller in CodeIgniter terms) using a module?


I am creating a module that I am going to use on a number of different projects. It’s basically going to show item details.

I am hoping to have accessible via a channel, once the module is installed, a form that I create to Add, Edit and delete these items.

Is it possible to have the channel (with a View loaded in) automatically set up via module (so I don’t have to recreate the channels on every install of the module)? How do I do it?

thanks for the help!

-Jayson

       
Bjørn Børresen's avatar
Bjørn Børresen
629 posts
15 years ago
Bjørn Børresen's avatar Bjørn Børresen

Hi,

in your upd.modulename.php install() function you’ll have to insert the necessary info into exp_channels, and then maybe also exp_field_groups and exp_channel_fields. I’d do a mysqldump of the db, then create a channel/fields with all the info you want, then do another db dump and then compare the two to know what you need to add in your install() function.

Check out devkit to generate the module skeleton: http://www.bybjorn.com/344/

😊

       
Jayson Ng's avatar
Jayson Ng
67 posts
15 years ago
Jayson Ng's avatar Jayson Ng

awesome idea Bjorn! thanks!

I am using the devkit module too. 😊

       
Bjørn Børresen's avatar
Bjørn Børresen
629 posts
15 years ago
Bjørn Børresen's avatar Bjørn Børresen

Cool, good luck with the module! 😊

       

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.