Edit on GitHub
Jump to docs navigation

Twig Components / Methods / config

config = object(Bolt\Configuration\Config) is a Twig global to be used to access the configuration available in your config.yaml and contenttypes.yaml files. It has a bunch of useful methods.


Returns a config value using a path

{% set sitename = config.get('general/sitename') %}
{% set accepted_file_types = config.get('general/accept_file_types') %}


Returns true if config matches path, and false otherwise.

{% set has_sitename = config.get('general/sitename') %} # returns true
{% set has_fakedummy = config.get('fake/dummy) %} # returns false


Returns the configuration for the given contenttype.

{% set homepage_config = config.contentType('homepage') %}

Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.