drupal 7 用のモジュールを作成しています。モジュールは、そのブロック ['content'] 内にブロックとアイテム リストを生成します。標準のテーマ('item_list', array('items' => $items)) を使用している場合はすべて機能しますが、item_list の代わりに使用される独自のテーマを定義したい場合、ブロックが消えます。ドキュメントやさまざまな例を読んできましたが、何も役に立ちませんでした。モジュールのファイルに次のように書きました。
function lastposts_thm_theme() {
return array(
'lastposts_thm' => array(
'variables' => array('items' => NULL),
//template file, path, ....
),
);
}
function theme_lastposts_thm($variables) {
$node = $variables['items'];
$build = node_view($node);
$output = drupal_render($build);
return $output;
}
そして、block_view関数から呼び出すと、テーマ( 'lastposts_thm'、$ ...)が機能しません。私はどこを間違えていますか?