In D8 I've created a view and assigned it into a block,

  1. I've created corresponding template for both view and block.
  2. Most of the unwanted addition of div's and classes has been removed.

But the following empty div is still there in the rendered HTML

<div class="js-view-dom-id-e0cc1fe812f18c9b5d6660b04594c41b597ae5ee9b28cf43f718dc43b43a2f42">

Anyone experienced the same issue?


Is the view empty? AFAIK that's the div where the view results should be (may somebody correct me if I'm wrong).

And here's some info in general about what this class is all about: https://www.drupal.org/node/2573529

| improve this answer | |

Semantic Views makes unformatted styles, field row styles and other output more readily configurable without needing to override template files.

unfortunately it doesn't support drupal 8 yet.

| improve this answer | |

I did it overriding the views-view.html.twig template.

In your theme (or module) just duplicate the default template (from /core/modules/views/templates) and name it views-view--MYVIEW.html.twig

In the code, comment the div in the top (and the closing in the bottom):

{#<div{{ attributes.addClass(classes) }}>#}
  {{ title_prefix }}
  {% if title %}
    {{ title }}
  {% endif %}
  {% if feed_icons %}
    <div class="feed-icons">
      {{ feed_icons }}
  {% endif %}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.