You are here

function hook_blazy_form_element_alter in Blazy 8.2

Same name and namespace in other branches
  1. 7 blazy.api.php \hook_blazy_form_element_alter()

Alters blazy-related formatter form elements.

This takes advantage of Blazy taking care of a few elements finalizations, such as adding #empty_option, extras CSS classes, checkboxes, states, etc. This is run before hook_blazy_complete_form_element_alter().

Parameters

array $form: The $form being modified.

array $definition: The array defining the scope of form elements.

See also

\Drupal\blazy\Form\BlazyAdminBase::finalizeForm()

Related topics

1 invocation of hook_blazy_form_element_alter()
BlazyAdminBase::finalizeForm in src/Form/BlazyAdminBase.php
Returns re-usable logic, styling and assets across fields and Views.

File

./blazy.api.php, line 293
Hooks and API provided by the Blazy module.

Code

function hook_blazy_form_element_alter(array &$form, array $definition = []) {

  // Limit the scope to Slick formatters, blazy, gridstack, etc. Or swap em all.
  if (isset($definition['namespace']) && $definition['namespace'] == 'slick') {

    // Extend the formatter form elements as needed.
  }
}