I tried to show the search box in a custom front page, which is a regular HTML page.

How can I achieve it?

  • Going to need version of Drupal and to see how you are trying to add it (code). Also are you trying to use a custom template file for your homepage, or your homepage isn't in Drupal at all? – kevindeleon Aug 2 '12 at 23:20
  • I think you should read more on how Drupal work, Creating a new blank HTML page is not the right way to create a custom front page. take a look here for starters drupal.org/node/265172 – saadlulu Oct 7 '12 at 9:23

I'm not sure if this is exactly what you're asking, but if you want to output a block directly in code you can use module_invoke().


Drupal 7

$block = module_invoke('block', 'block_view', 'current_search');

Drupal 6

$block = module_invoke('block', 'block', 'view', 'current_search');

Then render the contents of $block.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.