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

FiNeX created an issue. See original summary.

bloomt’s picture

I am having the same issue... did you get this resolved?

Danny Englander’s picture

You'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.

{% if header|render %}
      <{{ header_wrapper }}{{ header_attributes.addClass('group-header') }}>
      {{ header }}
      </{{ header_wrapper }}>
  {%- endif -%}

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.

aspilicious’s picture

Status: Active » Fixed

Usually 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.