I'm theming Drupal 7.10 using Bartik as a basis. When logged out, I'm seeing that an empty tabs div
<div class="tabs"></div>
is being created even though in the page.tpl.php, it has

      <?php if ($tabs): ?>
        <div class="tabs">
          <?php print render($tabs); ?>
        </div>
      <?php endif; ?>

This is causing a layout issue because .tabs has margin-bottom of 20px. Any thoughts on why this is happening?

Comments

no2e’s picture

I have the same problem.

The default page.tpl.php contains:

<?php if ($tabs): ?><div class="tabs"><?php print render($tabs); ?></div><?php endif; ?>

For anonymous users, it creates the following markup:

<div class="tabs"></div>

How can I disable this? I don't want such an empty element to be created.


Edit:

I found an issue: http://drupal.org/node/997408

no2e’s picture

Instead of

<?php if ($tabs): ?>
  <div class="tabs"><?php print render($tabs); ?></div>
<?php endif; ?>

use

<?php if ($tabs = render($tabs)): ?>
  <div class="tabs"><?php print $tabs; ?></div>
<?php endif; ?>
hmartens’s picture

Thanks no2e your solution works!

I've been trying for days to get this sorted out and your simple solution works ;)

You would have thought by 2013 they would have looked at fixing this ;)

Living life in a grande way.