tags:

views:

44

answers:

1

When you want to create a region in a node.tpl template, you simply put

function xnalaraartbasic_preprocess_node(&$vars) {
  $vars['your_region'] = theme('blocks', 'your_region');
}

in template.php. But how do you put a region in comment-wrapper.tpl? I couldn't find a hook for comment.

+2  A: 

The comment-wrapper preprocess function (template_preprocess_comment_wrapper) begins on line 1825 of comment.module. Try something like this in your theme's template.php:

function xnalaraartbasic_preprocess_comment_wrapper(&$vars) {
  $vars['your_region'] = theme('blocks', 'your_region');
}

And then in your theme's comment-wrapper.tpl.php, try:

<div id="your_region">
  <?php print $your_region; ?>
</div>
<div id="comments">
  <?php print $content; ?>
</div>

And don't forget to flush your theme registry!

peterjmag
Just when I had solved it by printing a region at the bottom of the node.tpl instead :P oh well, the code makes more sense with the region in the comment wrapper. Thanks!
Toxid