/frog-rain

Opinionated starter kit for Magnolia CMS frontend development

Primary LanguageJavaScript

Frog Rain

Frog Rain is an opinionated starter kit for Magnolia CMS frontend development. It contains everything necessary to kickstart a Magnolia site project with no Java coding required.

Frog Rain was inspired by Topher Zimmermann's magnolia-lighter and that scene from Magnolia the movie.

Why would I want to use it?

Building a Magnolia build environment for light module development is no rocket science, but since there are not many opinionated boilerplate projects available for it there's a lot of decisions for you to make. This project encapsulates some of the best practices we at Houston Inc have ended up with, while still allowing you to use the frontend technologies you know and love.

Frog Rain is built on the principle that all components and pages have their own isolated styles and JavaScript functionality. Any component JavaScript or its dependencies will not be loaded unless they are actually used on the page. This helps keep the project tidy and minimize unnecessary JS downloading and execution.

How do I use it?

Clone the repository and modify it to your needs. To see how it works, install the dependencies, build the project with gulp, and create a page in Magnolia.

1. Install dependencies:

npm install

2. Build the project:

gulp

This will build the files in src into the magnolia-modules directory.

3. Start up Magnolia and connect it to the files.

Connecting Magnolia to the files can be done in any of these three ways:

  • Point your Magnolia instance's magnolia.resources.dir at the magnolia-modules directory.
  • Use symlinks to link from your instance to the magnolia-modules directory.
  • Copy the files from magnolia-modules directory to your instance.

Or use the included Vagrant files to launch a local Magnolia virtual server (requires Vagrant and VirtualBox):

vagrant up
vagrant rsync-auto

Access it at http://localhost:8888.

4. In Magnolia, create pages with the new templates, and add the component to the pages.

Notice that the "Simple example" component automatically loads and runs the javascript that it needs.

Likewise, notice how the "Page with script" page template automatically loads and runs the script provided in its src directory.

What is included

What is not included / out of scope

  • Any fancy UI or styles
  • Grid library (we recommend Reflex)
  • CSS naming conventions (we recommend BEM)
  • UI toolkit such as Bootstrap or Foundation
  • Any external fonts or icon kits
  • MTE (Magnolia Templating Essentials)
  • YAML extends (will be natively supported in a near future release of Magnolia)