CMSstash

GRAV

Grav is a modern and open source flat file CMS. Grav has been created by Andy Miller from RocketTheme and it quickly became popular in the community. One of its specials: Grav has its own package manager.

Screenshot of the grav-website

Grav was introduced in the summer of 2014. According to its founder, Andy Miller, Grav is focused on speed, simplicity, and flexibility. Grav was probably the first open-source CMS in the flat-file world that approximates the level of commercial flat-file systems like Kirby and Statamic. In fact, the concept and the technology of Grav are similar.

Grav for Content Managers

Grav offers two download versions: one with an integrated control-panel for content-editors and admins and one without. The control panel is pretty nice, if you (or your content-editors) love dark colors.

The control panel is a mixture of an admin dashboard and an editor’s dashboard. Many workflows and features are a bit more focused on the developer’s and admin’s needs, while very unexperienced content editors might have some trouble to find the right button now and then. If you don’t like it at all (the statistics are not thaaat meaningful), then you can try to change everything with the many configuration-options of the site (e.g. configure the dashboard or redirect the user after a login).

Screenshot of the grav control panel

Editors will create new content in the “pages”-section. Grav does not separate between content-types like “pages” and “news”. Instead, you can choose between different templates for each site. The content is created with traditional forms, and this is one main advantage of several high-level, flat-file CMS: Tthe developer can tailor the forms exactly to the editor’s needs, so you won’t find any overhead.

Grav uses a markdown editor for content and formatting. Markdown is a formatting-language similar to the markup, that Wikipedia uses. Which means that you get a bunch of characters for #headlines, italic-text, bold-text and all the other formatting-options. Grav uses some kind of WISYWIG-editor for markdown, so you will directly see the result of your formatting with markdown. I personally like markdown, because it is super clean and you don’t run into the formatting-trouble of JavaScript-editors. But it’s true: Not all authors will love it…

The image-handling of Grav is pretty comfortable and easy, but there is no real digital asset management, so the whole media-handling has some limits.

You have a modern drag and drop field for bulk-uploading. But you cannot add any metadata to the images in the admin-panel. The only way to do this is to upload a special YAML configuration file with the same name as the image. Then the images and the meta data are directly connected.

The limitations of this system becomes clearer, if you try to create slideshows with captions. Because of the missing meta-data for images, this does not seem to be possible with the admin-panel in a straight-forward way right now (which means without the upload of seperate meta-files or the creation of separate pages for each image).

If you want to position an image in a more individual way, then you have to add it to the markdown editor. Grav profides a lot of options for image manipulation, but you have to use a special syntax for this, which can be quite tricky for content-managers without a lot of tech skills.

If your website-concept does not rely on complex image-handling, then Grav has enough options for you. And Grav provides a lot of other out-of-the-box options for editors and admins. There are taxonomies, translations for the admin-panel, multi-site-feature, multi-language-pages, and much more.

Grav for Developers

Grav has a minimal technology stack. It runs on a web-server with PHP 5.5.9 and greater. Besides that, Grav makes use of a lot of modern and fresh technology:

Like with most flat-file CMS, the installation of Grav is pretty simple and straightforward. Just download the files, copy and paste them to your webserver or local folder, and go to your-domain-or-folder/. If you have the version with the admin panel, then a simple form will appear that will help you to create a user account. After that, you are done and you will see the dashboard.

If you create a new theme for Grav, then you will mainly work with Twig templates and YAML configuration files. Like with most other flat file CMS, the magic happens with the combination of content files, YAML files, and Twig templates:

For example, if you want to create a title and a simple markdown editor field for the admin panel, then you add this to your default.yaml-file:

fields:
  header.title:
    type: text
    label: Headline
  content:
    type: markdown
    validate:
      type: textarea

Now the user can choose the template “default” and create a new page (folder) with a content file named “default.md”. This file could look like this:

---
title: My page
---

# This is a headline in markdown

This is some text in markdown. There are some formattings like **bold** or even a [Link to a website](http://cmsstash.com).

With the default.html.twig template, the developer can output the content like this:

{% block content %}
    <h1>{{ page.header.title }}</h1>
    {{ page.content }}
{% endblock %}

This is the basic principle of Grav (and many other flat-file CMS). How Grav differs from other flat-file CMS is the fact that it stores everything in the user folder: content, themes, plugins, everything.

Another very interesting trick of Grav: It proveds a concept called “modular” pages. Modular pages are pages built with several editable and invisible sub-pages. This is a great concept, if you want to create complex and editable one pagers.

Compared to other flat-file CMS, Grav is a bit more complex and maybe confusing for newbies. So you should take the time and read the documentation carefully, before you start with your first project. You will find a link to the documentation in the fact sheet below.

Grav for Non-Coders

Grav is easy to install, it provides a good range of ressources, and the admin panel provides some options for customizations. So just give it a try. But don’t expect a ready-to-go concept similar to WordPress. What you can expect are about 70 themes, more than 150 plugins, and another 40 “skeletons” for developers. There are skeletons and themes for business websites, portfolio websites, landing pages, blogs, and much more.

If you are a code newbie, you can also try to work with Grav. But be prepared to use some abstract concepts like YAML and Twig (still easy to understand). So if you wan’t to start with clean PHP and html, then try another system.

Recommendation: When to use it

Flat-file CMS are generally great for all kinds of small websites, like landing pages, portfolio websites, and small business websites. Grav also provides skeletons for blogs, directories, documentations, and even for e-commerce. Because of the modular site feature, Grav is perfect for complex one pagers.

Be aware of some limitations of Grav (like missing meta information for images in the control panel). And mind the short history of the system. I ran into some minor bugs and missed some features, but the overall experience was pretty good. So if you are planning a simple website, just give it a try. If you are planning a complex business website, a complex blog, or whatever, then you might want to think about a more established CMS.

There are hundreds of private websites and small business websites running successfully with Grav. Just check the themes to get an impression of the character of these projects.