0

「test」というカスタムテーマを作成し、検索結果を表示しようとしています。

関数 test_preprocess_search_results() を template.php に追加しました (drupal ページ「function template_preprocess_search_results」からコードをコピーし、検索モジュールから「test」のテンプレート フォルダーに search-result.tpl.php をコピーします。

function test_preprocess_search_results(&$variables) { $variables['search_results'] = ''; if (!empty($variables['module'])) { $variables['module'] = check_plain($variables['module']); } foreach ($variables['results'] as $result) { $variables['search_results'] .= theme('search_result', array('result' => $result, 'module' => $variables['module'])); } $variables['pager'] = theme('pager', array('tags' => NULL)); $variables['theme_hook_suggestions'][] = 'search_results__' . $variables['module']; }

私は drupal を初めて使用します。私の懸念は、私の page.tpl.php ファイルで主張されている特定の div に検索結果を表示するにはどうすればよいですか? <?php print render($page['search_result']); ?>page.tpl.php divのようなことをしますか? デフォルトのテーマが検索結果を表示する場所をどのように認識しているのかわかりません。誰でも助けてもらえますか

ps:私がしたことの後、キャッシュを更新しても何も表示されません

4

1 に答える 1