Posted By

zack on 06/24/11


Tagged

drupal


Versions (?)

Best way to programmatically embed the Search Block in Drupal 7


 / Published in: PHP
 

  1. <?php
  2. /*
  3. * Preprocess page.tpl.php to inject the $search_box variable back into D7.
  4. */
  5. function template_preprocess_page(&$variables){
  6. $search_box = drupal_render(drupal_get_form('search_form'));
  7. $variables['search_box'] = $search_box;
  8. }

Report this snippet  

You need to login to post a comment.