Support Center

How to embed programmatically the Search block in Drupal 7

Last Updated: Sep 05, 2013 05:49PM EEST
If you want to embed the Search block on a specific page or block, just enable the PHP input format (make sure that you have already enabled the "PHP Filter" module) and use the following code:
 
<?php 
$block = module_invoke('search', 'block_view', 'search');
print render($block);
?>

In case this article leaves any of your questions or concerns unanswered, please feel welcome to email us or post a public question.

​More than (just) Themes
http://www.morethanthemes.com/

Contact Us

[email protected]
http://assets2.desk.com/
false
morethanthemes
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete