Community & Support

How to add custom block to top of content region instead of bottom

How can I add a custom block to the content region so it is being showed before the actual content, rather than after it?

Comments

learning this as well

your post wasn't very clear - as to what you want to move up on the node - but I'm going to guess you mean terms and Submitted by stuff

this might not be all that helpful, but I'm learning this as well - and I'll tell what I do, it might be the long way to OZ, but I learn along the way too.

1) the theme you are using is determing this

2) find a theme that does it the way you want

3) then compare the two, when you find the $terms stuff - you're in the right spot.

4) node.template.pho - is generally the file you want (in the theme you are using)

good luck - sorry I didn't have a magic wand answer.

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
"I would love to change the world,
but they won't give me the source code"
-JG

To be a bit more clear: You

To be a bit more clear: You can assign blocks to regions. When I assign a block to the content region it is being placed after the content and I would like to have it placed before. (The content is the actual node data.)

Edit page.tpl.php

This can be accomplished by editing the page.tpl.php. Create the block but, do not enable it, add the following code to your page.tpl.php. (18 is the number of the block so, you need to find out the number of the block you have created)

<div align="center">
<?php
$block
= module_invoke('block', 'block', 'view', '18');
print
$block['content'];
?>
</div>

I can't find the url right now but, the code is in the Handbook.

woo hoo

Yep that's true. Even if you assign a light weight of -10 to the block, in the content region, it will still sink to the bottom, after the "content". Thanks for the tip, gonefishing.

Thank you!!! good to know...

Site wide

I used the page.tpl.php because I wanted the block to appear on every page. The same bit of code can be added to node.tpl.php.

This worked, but it really

This worked, but it really should be cleaner from the theme.
Thanks.

New region

You could alternatively add a new region to your theme:

http://drupal.org/node/242107

www.drupalmuseum.com
www.organicsitedesign.com

I must be a real dummy cause

I must be a real dummy cause it doesnt work for me. I've tried in page.tpl and node.tpl and in either case my block keeps on being stuck at the bottom of my content.

nobody click here