Posted by jasonzh on December 20, 2012 at 10:17am
I use a module ,name is fist_moudle,to generate a block.
now I want to override the block output in mytheme/template.php.
how to do it?
-----
from this page http://drupal.org/node/350634
I practice to how to override the block of usr login,and success.
but when I try to override first_module. I failed.
(Note:I have created first_module.tpl.php in folder mytheme/tempaltes)
but failed to see the effect.
function mytheme_theme() {
$items = array();
$items['user_login'] = array(
'render element' => 'form',
'path' => drupal_get_path('theme', 'mytheme') . '/templates',
'template' => 'user-login',
'preprocess functions' => array(
'bh_bootstrap_preprocess_user_login'
),
);
$items['first_module'] = array(
'path' => drupal_get_path('theme', 'mytheme') . '/templates',
'template' => 'first_module',
'preprocess functions' => array(
'aaa'
),
);
return $items;
}
function aaa() { echo 'test test';
}---
Comments
Shouldn't this
Shouldn't this line
'template' => 'first_module',
be
'template' => 'first-module',
i.e. dash , not underscore
I usually do it in any
I usually do it in any module, but you will need hook_block_info and hook_block_view. Look up these hooks and you will see how to override the block.
BC
Bruce C
Hot Web Ideas, Inc.
thanks I use suggestion to
thanks
I use suggestion to fix it .
http://drupal.org/node/1089656
if don't use suggestion,is there a better way to fix it?
drupal ,the sharp skill to eastablish website.