Hi,
I'm experiencing a curious issue which I think is a bug.

When outputting blocks to standard drupal theme regions, block.module does a check to see if there is block content before invoking the block theme function.
e.g. from block.module around line 510: if (isset($block->content) && $block->content) { ....

When you create a block field in display suite, it does not seem to do this, and can still render the block template if the content is empty, resulting in HTML with a block div containing nothing.

In my case, I was using the menu_block module to create a conditional menu. When assigned to a normal drupal theme region, and on a page where there are no menu items, the block->content is blank, and so the block does not appear. When turned into a display suite block field, the HTML for the outer block template still appears, even when there is no content.

<div class="block block-menu-block " id="block-menu-block-1">
</div>

My current workaround is to override either block.tpl.php or theme_ds_eval_block() to add a conditional content check, but I think this is something which should be handled by display suite in theme_ds_eval_block() as standard?

I've attached a sample patch to fix this functionality.

CommentFileSizeAuthor
theme.inc_.patch1.37 KBgrahamgilchrist

Comments

swentel’s picture

Status: Active » Fixed

Makes sense, committed to 6.1 and 6.2 branch. Thanks!

Status: Fixed » Closed (fixed)

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