Posted By

zack on 09/01/11


Tagged

drupal


Versions (?)

adding drupal search in page.tpl in d7


 / Published in: PHP
 

  1. <?php
  2. /*
  3.  * Preprocess page.tpl.php to inject the $search_box variable back into D7.
  4.  */
  5. function MYTHEME_preprocess_page(&$variables){
  6. $search_box = drupal_render(drupal_get_form('search_form'));
  7. $variables['search_box'] = $search_box;
  8. }
  9. ?>
  10. Then you just need to print the variable in your page.tpl.php:
  11. <?php print $search_box; ?>

Report this snippet  

You need to login to post a comment.