Advanced content manager extension for Magento®
- a powerful CMS

Add ContentType in the setup data file

Maybe you need for your project to add some ContentType programmatically. Actually you can add ContentType, Content and ContentList programmatically, anywhere you want in your code.

In the example below, we explain how to add a ContentType while installing/upgrading your module.

First of all, initialize your Magento 2 module structure:
And don't forget to add Blackbird_ContentManager to your module dependencies.

Then add one of these classes, regarding what you need:

First install of the module:
Must implement \Magento\Framework\Setup\InstallDataInterface

Upgrade of the module:
Must implement \Magento\Framework\Setup\UpgradeDataInterface

For the version management, please see the references mentioned at <Magento2Root>/setup/src/Magento/Setup

Now in your setup file class, you should apply this: How to add Content programmatically?


60 days
free support


Made for developers
and webmasters

14 days money
back guarantee

Made by Magento
certified developers