function uikit_theme_suggestions_form_element_alter

8.x-3.x alter.inc uikit_theme_suggestions_form_element_alter(array &$suggestions, array $variables)
8.x-2.x alter.inc uikit_theme_suggestions_form_element_alter(array &$suggestions, array $variables)

Implements hook_theme_suggestions_HOOK_alter() for form element templates.

File

includes/alter.inc, line 84
Modify structured content arrays.

Code

function uikit_theme_suggestions_form_element_alter(array &$suggestions, array $variables) {
  $type = $variables ['element']['#type'];

  // Add suggestions with the element type.
  $suggestions [] = 'form_element__' . $type;

  // Add suggestions for checkbox and radios to style advanced form elements.
  $form_advanced = $type == 'checkbox' || $type == 'radio';
  if ($form_advanced) {
    $suggestions [] = 'form_element__' . 'advanced';
  }
}

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

Log in