@magnolia-services/my-light-module
v1.0.2
Published
Create and share Magnolia light modules.
Downloads
3
Keywords
Readme
@magnolia-services/my-light-module
Create and share Magnolia light modules.
- Creating the light module - Create the
hello-magnolia
module. - Sharing light modules – If you have some functionality that you think would be useful, like a component, consider sharing it with your fellow Magnolia developers.
Quick Overview
Start
npx mgnl install @magnolia-services/my-light-module --path .
It will create a directory called my-light-module
inside the current folder.
Inside that directory, it will generate the initial project structure:
my-light-module
├── apps
├── contentTypes
├── decorations
├── dialogs
│ ├── components
│ └── pages
├── i18n
├── includes
├── restEndpoints
├── templates
│ ├── components
│ └── pages
├── virtualUriMappings
├── webresources
├── .gitignore
├── LICENSE
├── package.json
└── README.md
No configuration or complicated folder structures, only the files you need to build your light module.
Folders Descriptions
apps
A Content app is a specialized app type for managing structured content. The content app user interface consists of a browser subapp and one or more detail subapps.
Please, see Automatically generated apps.
contentTypes
Allows defining Magnolia content types in a single YAML file of a light module.
Please, see Content type definition.
decorations
Definition decoration is a mechanism which allows you to change existing configured items such as apps, dialogs, field types and templates.
Please, see Definition decoration.
dialogs
A dialog is a pop-up featuring some content and actions to conduct some operations on that content. Please, see Dialog definition.
i18n
Please, see documentation page.
includes
As a best practice, place YAML files here that do not represent full definitions, but are included by the definition files. This prevents the problem where Magnolia tries to interpret an include file as a definition and ends up reporting that the file has problems.
restEndpoints
You can define multiple delivery endpoint.
Please, see Delivery API Configuration.
templates
A template definition gives a template a name and makes it available to the system. Please, see Template definition.
virtualUriMappings
Virtual URI mapping is a way to redirect an incoming request to the actual location of the content.
Please, see Virtual URI mapping.
webresources
Folder with scripts, stylesheet or other resource files. Please, see Web resources.
Modify
Modify the folder name to match your light module.
Modify the package.json
file to match your light module.
Create all files for your light module.
Publish to npm
npm publish
Magnolia provides a set of guidelines to make sure that light modules are easy to find and use by the community, but still ensure that the creator has total flexibility in how their light module is built.
| Guideline | Details |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Findable | Include the magnolia-light-module keyword in the npm package.json
file to make it easy for people to discover your module. |
| Ready-to-use | Publish your light module to npm in a ready-to-use state. A developer should be able to take the package from npm, drop it in their magnolia.resources.dir
(or light-modules directory), and then configure availability and how to include the web resources. |
| README | Provide a complete README.md
file to help people understand and use your module. |
License
@magnolia-services/my-light-module is open source software licensed as MIT.