I have tried for a few days now, to figure this one out on my own, but have had next to no luck getting a working solution.
The issue:
I have a view that displays a list of images, where all wrappers have been removed, so that it only contains the images themselves. I have also overwritten templates for this view, so that any additional wrappers from templates are also removed.
The issue is that views automatically adds <div class="views-element-container">
around the entire views. Normally this would be fine, but I have no need for it for this view, it's just cluttering the markup.
I know that it in some cases is used for additional functionality, such as the contextual links, but this has also been disabled for this view.
What I have tried:
- I have tried to figure out if views also adds a template suggestion to container.html.twig, but sadly found no indication anywhere on what that might be (even if I used normal views template naming convention, it didn't override)
- I have tried to access the views render array in a preprocess function, to unset #theme_wrappers, in hopes that this would prevent views from using the container. Sadly this also didn't do anything. Code example below.
function rodekors_preprocess_views_view__paragraph_gallery(&$variables) {
unset($variables['view_array']['#theme_wrappers']);
}
I simply want to remove the wrapper div from my specific view, yet have found no information on how to do that.
Does anyone know how to achieve this? Preferably without having to install a module for what should be such a simply thing to do.