Plugin Configuration | Flextype

Plugin Configuration

You can easily access plugin configuration and plugin information from your Twig templates and PHP files.

Accessing Plugin Information

Information for the currently enabled plugins you can get from the registry object.

Example information from /site/plugins/site/plugin.yaml

name: Site
version: 0.9.6
description: Site plugin for Flextype
icon: fas fa-globe
  name: Sergey Romanenko
license: MIT

You can reach any of these items in your TWIG templates via registry.plugins by using the standard dot-syntax:


Plugin name: {{ }}
Plugin version: {{ }}


Plugin name: Site
Plugin version: 0.9.6

You can also reach these same values from a Flextype plugin(s) with PHP syntax:


$plugin_name = $flextype->registry->get('');
$plugin_version = $flextype->registry->get('');

Accessing Plugin Configuration

Plugins have default and site configuration files, named settings.yaml located in /site/plugins/<pluginname>/ and in /site/config/plugins/<pluginname>/

For example, let us consider the Site plugin and there is a file called settings.yaml in the plugins site settings folder. The contents of this configuration file look like this:

enabled: true

Let us add some custom plugin settings. Open /site/config/plugins/site/settings.yaml and add new variable with value my_custom_var: "Lorem ipsum dolor sit amet"

enabled: true
my_custom_var: "Lorem ipsum dolor sit amet"

Then in your theme templates you can access these variable using the object:

<div>{{ }}</div>


Lorem ipsum dolor sit amet

In PHP you can access the current plugin configuration like this:

$my_custom_var = $flextype->registry->get('');
Language: en, ru