cms.theme.extendFormConfig

Extend form field configuration supplied by the theme by returning an array.

Note if you are planning on using assetVar to inject CSS variables from a plugin registration file, make sure the plugin has elevated permissions.

Example usage:

Event::listen('cms.theme.extendFormConfig', function ($themeCode, &$config) {
     array_set($config, 'tabs.fields.header_color', [
         'label'           => 'Header Colour',
         'type'            => 'colorpicker',
         'availableColors' => [#34495e, #708598, #3498db],
         'assetVar'        => 'header-bg',
         'tab'             => 'Global'
     ]);
});

Usage

Globally

use Event;

Event::listen('cms.theme.extendFormConfig', function () {
    // Your event listener code goes here...
});

Triggers

Class or file Line
Cms\Classes\Theme 410
Copyright © 2024 Winter CMS