Skip to main content
1 of 2
Lauren G
  • 384
  • 2
  • 10

You can use a preprocess function to add a theme suggestion specifically for this view.

Something like:

function rodekors_theme_suggestions_container_alter(array &$suggestions, array $variables) {
  // add "if" statement here to check for some value unique to your view
      $suggestions[] = 'suggested_template';
  // end "if" statement
}

Then you can copy the standard container template file, rename it 'suggested-template', and just remove the outermost wrapping div.

Because that views-element-container is a container around the view, you need to access / alter the code on the container level, instead of the view level. Most likely, even if your unset theme-wrappers code worked, the div would still exist, just without its class.

Lauren G
  • 384
  • 2
  • 10