Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Magnolia CLI

Introduction

Magnolia CLI is an npm package providing a CLI tool to setup and facilitate Light Development with Magnolia.

Installs the mgnl command which allows performing several key operations for Light Development. It enables creating modules, pages, and components without any special IDE or Java requirements

Advantages of Magnolia CLI

Light modules, page, area, and component templates are created automatically.

There is no need to restart the server.

Creating a Light Module

This command:

mgnl create-light-module onepager-light-module

generates this structure:

exercise-cli-light-module-1.png

Folders in the Light Module

All these folders are intended for a specific use:

$magnolia.resources.dir
  • The folder the 'magnolia.resources.dir' value points to
  • It is defined in: /webapps/magnoliaAuthor/WEB-INF/config/default/
<module-name>
  • The root folder of the module
  • The folder name is the name of the module
decorations
  • Enables decorating of configurations and definitions
dialogs
  • Where the dialog definitions (YAML files) are saved
  • Using Magnolia CLI tool, it creates the sub-folders 'components' and 'pages'
i18n
  • Way to adapt Magnolia to different languages and regional differences
templates
  • Folder for all the template definitions (YAML files) and template scripts (FTL files)
  • Using Magnolia CLI tool, it creates the sub-folders 'components' and 'pages'
resources
  • All the resources
  • Typically contains sub-folders; it could also be multiple folders
  • Using Magnolia CLI tool, it is named 'webresources'
  • While you are free to choose a folder name for the resources, we recommend you to use 'webresources' as is

   

   


  • No labels