Hi Jeff,

On some of my content types I've added a number of blocks to replace the default fields for title, body etc. I added the blocks to the main content region. However, they appear below the div with the article class and article is empty. This presents a problem in IE6/7 because it gives the emtpy div with the article class a height, which affect layout of other blocks.

Do you have any suggestions?

Thanks

Comments

Jeff Burnz’s picture

Add some css just for IE6/7 to zero the height where needed.

eft’s picture

Thanks, Jeff

I ended up wrapping the article div with an if statement in node.tpl.php though I imagine there is a better way to do it. I would rather not output any markup than empty markup. Maybe if the intent was for article div to be the container for all content in the Main Content region, it would be better for blocks placed in that region to be output inside the article div. But I'm a noob.

<?php if ($content || $submitted || $picture || $terms || $links || ($article_aside && !$teaser)): ?>

<div id="<?php print $article_id; ?>" class="<?php print $classes; ?>">
  <div class="article-inner clearfix">
    <?php if (!$page): ?>
      <h2 class="<?php print $title_classes; ?>">
        <a href="<?php print $node_url; ?>" rel="bookmark"><?php print $title; ?></a>
        <?php print $unpublished; ?>
      </h2>
    <?php endif; ?>
    <?php if ($submitted): ?>
      <p class="submitted"><?php print $submitted; ?></p>
    <?php endif; ?>
    <?php if ($picture): print $picture; endif; ?>
    <?php print $content; ?>
    <?php if ($terms): print $terms; endif; ?>
    <?php if ($links): print $links; endif; ?>
    <?php if ($article_aside && !$teaser): ?>
      <div id="article-aside" class="aside"><?php print $article_aside; ?></div>
    <?php endif; ?>
  </div>
</div>


<?php endif; ?>


Jeff Burnz’s picture

Sure, thats a better solution, sorry, my head is pretty messy after 20 hours of travel... he he

Jeff Burnz’s picture

Status: Active » Fixed
Jeff Burnz’s picture

Status: Fixed » Closed (fixed)

Cleaning up.