0
깨끗한 Pressflow 설치에서 hook_block 후크를 구현하는 데 문제가 있습니다. 어떤 이유로 나는 항상 내 모든 블록에 대해 ArrayArray를 출력합니다. 당신이 내 사용자 정의 hook_block 방법으로 덮어 볼 수Drupal Pressflow with 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"
}
}
: 그 이유는 테마 함수에서 $ 정보 변수로 설정되어 있다는 점이다. 이제 블록은 주제와 내용이 들어있는 배열을 반환하는 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;
}
}
종류와 관련,