In block.tpl.php, the code:

  <?php print $content_processed; ?>

  <?php print render($title_suffix); ?>

is incorrect. They should be in the opposite order.

CommentFileSizeAuthor
#3 1990530-block-tpl-fix-title-suffix.diff462 bytesznerol
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aliyakhan’s picture

print render($title_suffix); This is closing div for the titles added by module to wrap the content. Did you face any issues regarding same?

Anonymous’s picture

This is closing div

No, it's not.

According to the documentation in modules/block/block.tpl.php,

 * - $title_prefix (array): An array containing additional output populated by
 *   modules, intended to be displayed in front of the main title tag that
 *   appears in the template.
 * - $title_suffix (array): An array containing additional output populated by
 *   modules, intended to be displayed after the main title tag that appears in
 *   the template.

And the actual code there is:

  <?php print render($title_prefix); ?>
<?php if ($block->subject): ?>
  <h2<?php print $title_attributes; ?>><?php print $block->subject ?></h2>
<?php endif;?>
  <?php print render($title_suffix); ?>

  <div class="content"<?php print $content_attributes; ?>>
    <?php print $content ?>
  </div>

The suffix is meant to come right after the title, not after the content of the block.

Yes, I did have trouble with this, in a theme that set $title_suffix. It came out in the wrong place.

znerol’s picture

Status: Active » Needs review
FileSize
462 bytes

I agree, those two lines need to be swapped. Patch attached.

Jeff Burnz’s picture

Version: 7.x-3.1 » 7.x-3.x-dev
Category: Bug report » Feature request
Issue summary: View changes
Status: Needs review » Active

Somehow I totally overlooked this issue and patches.

Technically no change is needed. The only thing output by suffix (in Drupal core) is contextual links. I personally don't know of another module that uses this variable, so it's safe where they are. Really this is a feature request, there is no hard technical reason why I have to follow the documentation, and frankly I consider it to be rather overstating how we can or should use this variable. Its just not up to Core to tell me where to output contextual links, that is a theming decision.

If someone can show me a bug I'm all ears, otherwise I would prefer to leave this alone, mainly because there are so many existing AT installations and someone might have used this variable in their site (custom module etc), so could be a little dangerous to move it at this stage.

Jeff Burnz’s picture

Status: Active » Closed (won't fix)

I am setting this won't fix for D7 Adaptivetheme due to the above reasons.