开发者

Embedding a new region to a content-type node template

I'm new to Drupal, and the Drupal website is currently down, ahh!

I need to know how to add a region to a custom node template. I've tried adding the following function to template.php in the my_theme directory:

function my_theme_preprocess_node(&$vars, $hook) {

$vars['usersummary'] = theme('blocks', 'usersummary'); }

And then printing $usersummary in my node template node-content_type.tpl, but it doesn't开发者_如何转开发 work - I suspect because the template I need to show the block in is a node template for a specific content type named node-content_type.tpl. If I change the above function to

function my_theme_preprocess_node-content_type(&$vars, $hook) {

... }

I get an error. Note that I didn't intially set this site up, thus I need to work with existing theme setup, which I don't think is ideal but I don't really think is ideal, but am on a tight deadline.


Wow it turned out to be really easy. All I had to do was add the following into my node-content_type.tpl:

<?php print theme('blocks', 'usersummary'); ?>

No need for the template.php file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜