Skip to content

Powered by Grav + Helios

Plugins

Plugins

Grav is fully extensible with a powerful Plugin architecture to allow you to extend the core functionality and add as much functionality as you like.

Plugin Basics

Plugin Basics Tip Grav 1.8 Compatibility: If you are a plugin author, you should add the new compatibility: property to your blueprints.yaml to declare which Grav versions your plugin has been tested on. This is used by the Safe Upgrade system to ensure all plugins are ready before a m...

Plugin Installation

Plugin Installation Installation Installing a plugin can be done in one of three ways: The GPM (Grav Package Manager) installation method lets you quickly install the plugin with a simple terminal command. The manual method lets you do so via a zip file. The admin method lets you d...

Plugin Tutorial

Plugin Tutorial Plugins are usually developed because there is a task that can not be completed with Grav's core functionality. In this tutorial, we will create a plugin that helps Grav to deliver a random page to the user. You have probably seen similar functionality on blog sites as a way to...

Event Hooks

Event Hooks In the previous Plugin Tutorial chapter, you might have noticed that our plugin logic was encompassed in two methods. Each of these methods onPluginsInitialized and onPageInitialized correspond to event hooks that are available throughout the Grav life cycle. To fully harnes...

Grav Lifecycle

Grav Lifecycle It is often useful to know how Grav processes in order to fully understand how best to extend Grav via plugins. This is the Grav lifecycle: index.php Check PHP version to ensure we're running at least version 7.1.3 Class loader initialization Obtain Grav instance Gra...

Using Flex in a Plugin

Using Flex in a Plugin Introduction Flex usages, be in twig or in code, will be only covered for the purpose of this introduction. To understand the power and flexibily of Flex, please read our dedicated Flex documentation. Flex allows custom Objects CRUDS, as single object or collection, an...

API Integration

Plugin API Integration The Grav API plugin provides a RESTful API for Grav CMS. Any plugin can extend this API by registering its own endpoints via the onApiRegisterRoutes event. This guide walks through the pattern step by step. Overview When the API plugin is installed, it fires the onA...

Plugin Compatibility

Plugin Compatibility Starting with Grav 2.0, plugins and themes can declare which major Grav versions they are compatible with using the compatibility: property in their blueprints.yaml. This allows the upgrade system to verify that all installed extensions are ready before performing a major...