Drupal FAQ - How do I place a block above (before) the comments section (i.e., after the content body, but before the Comments section)?
UPDATE: This article was written for Drupal 6. I just wrote a new version of this, How to place a Block and a View above the Comments and below the Content for Drupal 8.
I’ve always wanted to move the “What’s Related” block on this Drupal website just below the content, and above the Comments section, and I finally took the time today to do that.
I’m happy to say I found a nice tutorial on how to accomplish this on a (now defunct) website named o-learn.com. The steps on that site jive with what I remembered from my Drupal programming books, specifically:
- Define a new block in your theme’s info file.
- Modify your template.php file with the block information.
- Modify the node.tpl.php file of your theme.
One thing not mentioned in that article is that you’ll probably need to make some changes to your CSS file(s), but you'll see that soon enough.
Similar Entries Drupal block before comments section
I’m glad to have “What’s Related” (technically the “Similar Entries” module) block below my content and above the comments section. I think that’s a much more natural place for this to reside, because if a reader doesn’t find what they’re looking for in the current article, they may find it in a related article, and having this above the comments section is much better than being on the side, where it used to be.
Custom PHP Drupal block
On a related note, if you’d like to create a Drupal block with your own custom PHP code, check out my Custom Drupal PHP block tutorial.