Why Grav - Choosing a Web Platform

website blog flat file CMS web platform

At StormFree, our goal is not only to develop solutions to the problems of the world, but to develop solutions that are simple and user friendly. So, when choosing a website platform, we stayed true to our roots and went with Grav CMS, a modern flat-file CMS developed by RocketTheme. Its tool offerings are developer, designer, and hosting friendly due to being flat-file based and using standard PHP install, which is common. It's also user friendly with simple administration navigation. This is first screen a user sees when they log in.

Because the StormFree website is simple, focussed, and doesn't require asset management, e-commerce, or advanced searching, the recommendation was to use a flat-file CMS instead of a regular CMS. A flat-file CMS is a unique CMS because the site content and configuration settings are stored in plain text files and not in a database. 

Technical Details Grav is built using modern, best-in-class technologies which include:

  • Twig Templating for powerful but secure control of the user interface
  • Markdown for easy content creation without the need for tags
  • YAML for simple configuration
  • Doctrine Cache for performance
  • Symfony Event Dispatcher for powerful plugin extensibility and control
  • Symfony Console for powerful maintenance and automated commands
  • Gregwar Image Library for dynamic image manipulation

Flat-file CMS Advantages and Disadvantages

We compiled a list of the advantages and disadvantages which we came across while determining the need for a flat-file CMS. 

Advantages

  • Fast Setup. Without the need to set up a database, files can be uploaded directly to the server.
  • Version Control. Because you only deal with files, you can add version control to the website using Git.
  • Secure. No database to hack.
  • Speed. Site loads quickly since there is no database, hence no database queries. 
  • Portable. Copy and paste is all that’s needed to move your website onto another server. With WordPress, Typo3, or Drupal, moving from one server to another can take a lot of work. The same applies to relocating a website and backing up a flat-file CMS.
  • Workflow. To make changes in a flat-file CMS or add new content, you can edit directly using your favourite editor. 

Disadvantages

  • Speed. Larger websites with a high volume of searchable and growing content, such as blog posts, require meta data indexing, which often requires a database to cross reference everything with fast-lookup indices. With a flat-file CMS, all data records have to be trawled through one by one. 
  • Media Library. There is no proper media library or centralized place to view files added to a page since there is no database.
  • No Database. Since there is no database, it does not allow for good inventory management necessary for e-commerce, asset management, or any level of advanced searching.

Why We Chose Grav

Once we decided that a flat-file CMS was the way to go for our site, and after comparing all the features the flat-file CMS systems offer, we chose Grav as our platform. Grav has been around for a while and has a fair bit of support and documentation. The admin console is easy to use and offers plenty of plugin options that integrate well and are kept up to date. Finding a skeleton/theme that works well with our original site was very easy and it allowed for easy customization using modules and partials.

We were seeking a good blogging system that allowed us to categorize, tag, and schedule future blog posts, a feature which Grav does well. Another important feature was to allow file attachments to create custom forms for job applications, which many of the flat-file CMS systems don't offer OOB. However, Grav did provide this feature OOB.

We have included the evaluation we performed on some of the top flat-file CMS systems based on important features required for the StormFree website, including Grav, Pico, Statamic, Batflat and Kirby.

All features rated on a 0-5 point rating system (0 = Non-existent, 1 = Poor, 2 = Adequate, 3 = Average, 4 = Above Average, 5 = High Average)

  • (P) Plugins support
  • (B) Blog Functionality
  • (CE) Content Editor Simplicity
  • (EU) Overall Ease of Use
  • (TAG) Tagging ability
  • (SEO) SEO integration
  • (F) Advanced forms support
  • (C) Custom CSS/classes support
  • (T) Theme support
  • (E) Easy to set up
  • (G) Sync/Version control with Git
  • (U) Users/Roles
  • (BR) Backup/Restore Functionality
  • (SD) Support/Documentation

Setting Up Grav

Because Grav is a flat-file CMS and doesn’t involve a database, it was very easy to set up. All that is required is a web server and PHP 5.5.9 or higher. If you are testing locally, you can use test environments such as MAMP, WAMP, and XAMPP. Follow these steps to set up Grav:

  1. Download Grav + Admin plugin.
  2. Unzip in your Webroot.
  3. Point the browser to where you unzipped the Grav folder.
  4. You will be directed to the "Register Administrator Account" screen where you can create the Admin account.
  5. Once the Admin account is created, you are already logged in and may begin adding content immediately.

Grav's Features

So clearly, Grav has many features making it the ideal choice for us. Whether or not they are applicable to your needs, they are worth noting, as follows:

  • Admin interface allows you to:
    • add and edit pages and articles
    • configure the entire system and plugins
    • run updates and backups
    • clear the website cache manually
  • Offers many plugins, themes, and skeletons (all-in-one thematic packages consisting of Grav core, theme, plugins, and sample content).
  • Twig templating is a fast, secure, modern, and flexible template engine for PHP.
  • Twig is easy to learn, allowing web designers to get the job done more efficiently.
  • Markdown is a lightweight markup language with plain formatting syntax.
  • Multi-language support.
  • Updates are easy to apply to the CMS and plugins.
  • Great documentation with detailed and organized coding examples for Twig and Markdown.
  • Built with modern technologies such as Modern PHP standards, Markdown, Twig, YAML, etc.
  • Limitless taxonomies enabling you to label and filter content as you wish, with no extra coding steps.
  • Built-in image editing allows you to edit images as they are added.
  • Framework freedom allows you to use any css framework you like and theming is very simple.

Grav's Shortcomings

Like anything, there are a few shortcomings with Grav, and they too deserve a mention, as noted:

  • Grav is not scaleable and is not optimized for large websites (1000s of pages). Building collections and taxonomies need to parse through all pages.
  • End users must learn how to use Markdown as Grav is Markdown dependent. Many clients are used to using a WYSIWYG editor.
  • Groups and user management is not built in. There is a third-party plugin but it does not work properly.
  • There is no media library to manage large amounts of images.
  • Dates are not translated.

Our Experience

The ability to use a skeleton as a base for the website and customizing it using the Twig template language, modular pages, and plugins, allowed us to create exactly what we needed for the website.

The learning curve for creating and modifying templates using Twig was not too steep. There are many resources out there with examples of Twig code. Also, being able to download other Grav skeletons and inspecting the code of other Twig files allowed us to customize the functionality of existing page modules, such as featuring the latest blogs on the homepage.

Twig's template engine also makes it easy to create new custom modules you can insert in a specific page. For example, you could create a custom “Hello World!” twig module and create a modular sub page underneath the homepage which adds a section to the homepage. Then fill in the “Hello World!” content within that modular page using Markdown which allows for easy-to-use content syntax. For example, adding a heading to"Hello World!" is as simple as typing in ## Hello World! to create an H2 heading.

Overall, our experience learning and using Grav CMS to create the StormFree website was fairly simple and user friendly, which is, if you recall the first line of this post, kind of our thing.

Previous Post Next Post