I wonder how I can add a class to the form tag (of the \_search\_content\_ view's) exposed form using `template_preprocess_views_exposed_form()` (or even better `template_preprocess_views_exposed_form__search_content()`). The form is **exposed as block**.

It works so far using the following code in MY\_THEME.theme:

```
function MY_THEME_preprocess_form(&$variables) {
  if ($variables['element']['#form_id'] == 'views_exposed_form' && $variables['element']['#view_id'] == 'search_content') {
    $variables['attributes']['class'][] = 'row';
  }
}

```

But I can't get it work for:

```
function MY_THEME_preprocess_views_exposed_form__search_content(&$variables) {
  // I tried:
  // $variables['attributes']['class'][] = 'does-not-work';

  // and also:
  // $variables['attributes'] = new Attribute($variables['attributes']);
  // $variables['attributes']->addClass('does-not-work');

  // and also manipulating $variables['form'], but this didn't work either.
}

```

The function gets called, but it's not adding the class to the form tag. **Is it possible to get it work with `template_preprocess_views_exposed_form()`?**

Screenshot of `kint($variables)` output, for each function:

[![enter image description here](https://i.stack.imgur.com/9GkZh.png)](https://i.stack.imgur.com/9GkZh.png)

Is it possible to get it work with template\_preprocess\_views\_exposed\_form()?