Skip to main content
replaced http://drupal.stackexchange.com/ with https://drupal.stackexchange.com/
Source Link

i don't think that this will help you but do it like this:

// template.php
function MYTHEME_preprocess_page(&$variables){
  $search_box = drupal_render(drupal_get_form('search_form'));
  $variables['search_box'] = $search_box;
}

page.tpl.php:

<?php print $search_box; ?>

according to this [discussion][1]. You should not put your logic into tpl. [1]: httphttps://drupal.stackexchange.com/questions/10282/how-can-i-insert-search-box-in-page-tpl

i don't think that this will help you but do it like this:

// template.php
function MYTHEME_preprocess_page(&$variables){
  $search_box = drupal_render(drupal_get_form('search_form'));
  $variables['search_box'] = $search_box;
}

page.tpl.php:

<?php print $search_box; ?>

according to this [discussion][1]. You should not put your logic into tpl. [1]: http://drupal.stackexchange.com/questions/10282/how-can-i-insert-search-box-in-page-tpl

i don't think that this will help you but do it like this:

// template.php
function MYTHEME_preprocess_page(&$variables){
  $search_box = drupal_render(drupal_get_form('search_form'));
  $variables['search_box'] = $search_box;
}

page.tpl.php:

<?php print $search_box; ?>

according to this [discussion][1]. You should not put your logic into tpl. [1]: https://drupal.stackexchange.com/questions/10282/how-can-i-insert-search-box-in-page-tpl

Source Link
xurshid29
  • 2.5k
  • 15
  • 13

i don't think that this will help you but do it like this:

// template.php
function MYTHEME_preprocess_page(&$variables){
  $search_box = drupal_render(drupal_get_form('search_form'));
  $variables['search_box'] = $search_box;
}

page.tpl.php:

<?php print $search_box; ?>

according to this [discussion][1]. You should not put your logic into tpl. [1]: http://drupal.stackexchange.com/questions/10282/how-can-i-insert-search-box-in-page-tpl