Magnolia 6.0 reached end of life on June 26, 2019. This branch is no longer supported, see End-of-life policy.
This tutorial guides you through the process of creating a content app in Magnolia. The app you create is called the Bookshelf app and you create it as a Magnolia light module from a custom content type definition.
The tutorial consists of three pages:
Going through the tutorial you learn:
If you want to skip the tutorial and install the final app immediately, clone the repository containing the ready-made Bookshelf app as a light module directly into your Magnolia light module folder with the command:
git clone -b release/6.0 --single-branch https://git.magnolia-cms.com/scm/documentation/bookshelf.git
The Bookshelf app you create in this tutorial is an example of content app. It is a simple book catalog allowing the user to store bibliographic data about each book: its title, the names of the author(s), publisher's name and the ISBN-13 number. The app also allows you to group selected book items into folders called shelves in the app.
What is a content app?
The Bookshelf app consists of two subapps.
In the Book Browser subapp, you can:
The Book Detail subapp is a place where you can create and edit a book's bibliographic properties using text fields and a checkbox field.
For each book item, the Bookshelf app stores and retrieves the following content properties:
The Bookshelf app is based on Magnolia content types. Expand the following link to see more details about the app's design parameters.
Magnolia stores content in the
magnolia repository, a JCR repository that is divided into workspaces. The Bookshelf app is to store all books in a new workspace called
books workspace, each book is a custom
lib:book node type defined for this tutorial.
Each book of the
lib:book type can have the following content properties:
|Property name||Usage||Data type||Restriction|
|Name(s) of the author(s) of the book.||String||none|
|The property to store the ||Boolean||none|
|Official book title.||String||none|
|Description of what the book is about.||String||5000 characters max.|
|Book publisher's name.||String||none|
|Date of publication of the book.||Date|
|International Standard Book Number in the 13-character variant.||String|
When you create an app from a content type definition, the
name property is generated automatically. Then the JCR node name is automatically deduced from the name.
We make use of this auto-generated
name property in the Bookshelf app by:
Using it for creating a short and hyphenated book identifier (JCR node name) such as:
Therefore, in the Bookshelf app, the data in the Cataloging name field must be entered using the following syntax:
<first-author's-surname> <publication-year> <short-form-of-the-book's-full-title>
Hawking 2005 God Created the Integers
Magnolia automatically replaces the spaces with hyphens when creating a node name from the
Book data in the
books workspace and in the Book Detail subapp
Compare the following images, which show an example book item of type
lib:book and its various bibliographic data stored in the
books repository as seen through the interface of JCR Browser app (on the left), and the book data in the fields of the Book Detail subapp (on the right). Note especially the correspondences between the property names in the
books workspace and the fields in the Book Details tab:
On the next page, you create a basic Bookshelf app.