@magnolia/cli-create-content-type-plugin
v1.0.0
Published
A plugin for Magnolia CLI to create a content-type in a light module
Downloads
31
Readme
CreateContentTypePlugin
A plugin for Magnolia CLI to create a content-type in a light module
Installation
Using add-plugin
Run the following command in the project's root directory:
npm run mgnl -- add-plugin @magnolia/cli-create-content-type-plugin
The command will install the plugin, and automatically register the plugin in
mgnl.config.js
file:import CreateContentTypePlugin from "@magnolia/cli-create-content-type-plugin"; export default { plugins: [ new CreateContentTypePlugin() ] };
To confirm that the plugin has been successfully installed, run:
npm run mgnl -- create-content-type --help
Manually
- Run the following command in the project's root directory:
npm install @magnolia/cli-create-content-type-plugin
- Manually add CreateContentTypePlugin to mgnl.config.js file:
import CreateContentTypePlugin from "@magnolia/cli-create-content-type-plugin"; export default { plugins: [ new CreateContentTypePlugin() ] };
- To confirm that the plugin has been successfully installed, run:
npm run mgnl -- create-content-type --help
Usage
Options
| Short | Long | Description |
|--------------|--------------------------|---------------------------------------------------------------------------------------------------------------------------|
| -a <name>
| --app <name>
| configure the content app and associated workspace by creating a new app or choosing an existing one (recommended plural) |
| -lm [name]
| --light-module [name]
| set the light module for the content-type; defaults to the directory specified in mgnl.config.js file |
| -pd <path>
| --prototype-dir <path>
| use the specified path to the custom prototype templates directory as the prototype source for content-type creation |
| -p [name]
| --prototype [name]
| select a prototype for content-type creation |
| -v
| --version
| output the version number |
| -h
| --help
| display help for command |
Examples
Create content-type
npm run mgnl -- create-content-type "myFooContentType"
This command creates a new content-type based on the "_default" prototype. If neither the lightModulesPath nor the lightModule property exists in mgnl.config.js, the plugin will prompt you to choose each.
Create content-type and app
npm run mgnl -- create-content-type "myFooContentType" --app "myFooApp"
This command creates a new content-type called "myFooContentType" and a new app called "myFooApp" based on "_default" prototype. If neither the lightModulesPath nor the lightModule property exists in mgnl.config.js, the plugin will prompt you to choose each.
Plugin Documentation
For detailed documentation of the plugin, please refer to Plugin Documentation
Magnolia CMS
This plugin is created to work with Magnolia CMS. For more information, please refer to Magnolia CMS Documentation