Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, I'm using DS 8.x-2.5 with ds-1col template and Drupal 8.1.7.
I've created a node with only a field (field_body) and the full node display use ds-1col.
Even if the body is empty the DS template is printed:
<div class="node node--type-page node--view-mode-full ds-1col clearfix" data-history-node-id="3">
</div>
Surrounding the template code with {% if ds_content %} ... {% endif %}
doesn't solve the problem.
Thanks for the attention.
Comments
Comment #2
bloomt CreditAttribution: bloomt commentedI am having the same issue... did you get this resolved?
Comment #3
Danny EnglanderYou're close, you can hide empty regions by using the render argument. For example, I did this with a DS header region in one of my custom templates.
That will check to see if any fields are actually being rendered within a given region. I could not find any documentation on this, it's something I picked up from the Drupal Twig slack group.
Comment #4
aspilicious CreditAttribution: aspilicious commentedUsually it works out of the box, but if you have twig template suggestions turned on, it detects the suggestions as "content".
Thnx Danny for the tip.