0

I have created a block for a horizontal ad. I positioned it in the Content region and as you know I can display it either above the content or below everything. However, I would like it positioned above the editor (or comments area), not above it all.

I have found this pots but I am using an Omega-based theme and I see under the all/themes/omega/templates folder that there are "region.tpl" files so I assume here is where I add it, not in a node.tpl.php file.

1 Answer 1

0

Omega based themes still allow for custom regions and various *.tpl.php files. There is probably a node.tpl.php theme file in the base theme thats inherited by the subtheme your using.

The code doesnt go in the tpl.php file it goes in the preprocess function:

How to display block in node above comments. What i have tried is: create region - regions[above_comments] = Above comments after in template.php i have added this to THEME_preprocess_node

You then output the correct block within the specific region of the theme. In the linked page they created a region called Above comments in their theme. They set a block to that region using the Blocks Admin UI and rendered it using block_get_blocks_by_region using the theme preprocess function.

1
  • I opened preprocess-region.inc and this is what I see: <?php if (in_array($vars['elements']['#region'], array('user_second', 'menu'))) { $theme = alpha_get_theme(); switch ($vars['elements']['#region']) { case 'user_second': $vars['secondary_menu'] = $theme->page['secondary_menu']; break; case 'menu': if (isset($theme->page['dropdown_menu'])) { $vars['dropdown_menu'] = $theme->page['dropdown_menu']; } break; } } @tenken
    – Big Robots
    Commented Mar 13, 2013 at 2:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.