/**
* Implements hook_form_FORM_ID_alter().
*/
function register_form_views_exposed_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
//You need to verify the id
if ($form['#id'] =='views-exposed-form-search--page-1') {
// print_r($form);
//Setting placeholder
$form['keys']['#prefix']= '<div class="icon"><i class="fa fa-search" aria-hidden="true"></i>';
$form['keys']['#attributes']['placeholder'] = t('Search for Topics');
$form['keys']['#attributes']['class'][] = 'forum_spec_search';
unset($form['keys']['label']);
$form['keys']['#sufix']= '</div>';
}
}
Comments
Post a Comment