0
我有一個乾淨的Pressflow安裝實施hook_block掛鉤的問題。出於某種原因,它總是爲我所有的塊輸出ArrayArray。這樣做的原因是,在主題功能的$信息變量設置爲:Drupal Pressflow問題與hook_block
["block"]=>
array(7) {
["function"]=>
string(10) "fwtb_block"
["include files"]=>
array(0) {
}
["type"]=>
string(12) "theme_engine"
["theme path"]=>
string(21) "sites/all/themes/fwtb"
["arguments"]=>
array(1) {
["block"]=>
NULL
}
["theme paths"]=>
array(2) {
[0]=>
string(14) "modules/system"
[1]=>
string(21) "sites/all/themes/fwtb"
}
["preprocess functions"]=>
array(2) {
[0]=>
string(19) "template_preprocess"
[1]=>
string(25) "template_preprocess_block"
}
}
,你可以看到,這是改寫我的自定義hook_block方法。所以現在它認爲塊應該使用我的fwtb_block方法呈現,它返回一個包含主題和內容的數組。這就是它打印ArrayArray的原因。任何想法在這裏出了什麼問題?
這是我hook_block實現:
function fwtb_block($op = 'list', $delta = 0, $edit = array()) {
switch ($op) {
case 'list':
$blocks['sidebar_description'] = array(
'info' => t('Sidebar description'),
'cache' => BLOCK_CACHE_GLOBAL,
'status' => TRUE,
'region' => 'left',
'visibility' => 0,
'custom' => FALSE
);
return $blocks;
case 'configure':
$form = array();
return $form;
case 'save':
return;
case 'view': default:
switch ($delta) {
case 'sidebar_description':
$block['subject'] = t('block_subject');
$block['content'] = t('block_description');
break;
}
return $block;
}
}
親切的問候, 大安