Hi, I really appreciate your theme and support!

I just upgraded from 7x-2.3 to 7x-3.1 and noticed that blocks in the Main Content region no longer have the <div class="block-inner"> wrapper.

I think I need to override block.tpl.php, but I'm not sure exactly what code to put in there that will add the wrapper back in for Main Content blocks while keeping everything else the same. Does anyone have a suggestion?

Comments

nesta_’s picture

You use a subtheme? or a at_core?

mollybt’s picture

Hi, I am using a subtheme....copied block.tpl.php from at_core to my subtheme.

nesta_’s picture

You code is not: ???

<section id="block-block-X" class="block block-block contextual-links-region odd first">
   <div class="block-inner clearfix">  
      <h2 class="block-title">segundo título</h2>
      <div class="block-content content"><p></p></div>  
   </div>
</section>
mollybt’s picture

No, not for blocks in the main content area. For example you can see here:
http://housing.drupaldev.oist.ucsb.edu/future-residents

There is no <div class="block-inner clearfix"> , only

<div id="block-block-x" class="block block-block contextual-links-region no-title">
<div class="contextual-links-wrapper contextual-links-processed">
</div></div>

I believe that is by design, from reading the documentation in block.tpl.php :
"* - $content_processed: Pre-wrapped in div and attributes, but for some
* blocks these are stripped away, e.g. menu bar and main content."

Jeff Burnz’s picture

Status: Active » Fixed

Its by design, I will try to explain briefly without getting into a major discussion (easily done on this point...).

Long story short - Drupal can output almost anything via the "main content" region - could be a block, a panel or other view e.g. taxonomy terms. Remember, Drupal 7 can run with the block module switched off and output almost anything you want, while that sounds good to be frank unless you are using Panels then not using block module is not really an option in this theme, nor any theme for that matter.

This makes its incredibly problematic to hinge critical layout on markup that might not be there, such as block markup. Almost everywhere else in the theme block-inner has margin to create the gutters, however for the main content we add that margin to the #main-content wrapper div - I am forced to do this because of the aforementioned issues with relying on block markup.

This is why the block-inner div is removed from the main content block. I could just remove the class, but I decided to remove the whole div.

Remember you can always add markup back in, either by creating a block template or in your theme block process function.

mollybt’s picture

Thanks for the explanation Jeff, it makes sense.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

added code tag

demonde’s picture

How can I manually get back the block-inner in the main region in the theme code? Is there a way to achive this with submodule function in template.php?