Please Disable Your Browser Adblock Extension for our site and Refresh This Page!

our ads are user friendly, we do not serve popup ads. We serve responsible ads!

Refresh Page
Skip to main content
On . By CodimTh
Category:

in this article, I'll show you how to force template twig for your form element using $info['template'] 

/**
 * @param $variables
 * @param $hook
 * @param $info
 */
function mytheme_preprocess_form_element(&$variables, $hook, &$info)
{
  if (isset($variables['element']['#id'])) {
//    $id = $variables['element']['#id'];
//    $info['template'] = str_replace('_', '-', $hook) . '--' . $id;
    $info['template'] = 'form-element--edit-keys';
  }
}

and then you should create form-element--edit-keys.html.twig file in your theme

 

 

Tags :

Comments

Add new comment

Restricted HTML

Search

Page Facebook

Become a patron

If you need some help or you search a Drupal freelancer don't hesitate to contact us.

 

Contact Us

All the content is FREE but I still need your help

 

Become a patreon