Is there anyway to add a custom search bar on the header of a Views page? I tried using adding a 'text area' in the header with PHP formatting and I put the code below in but it didn't work.

<?php
  php if (isset($search['extra_field'])): ?>
    <div class="extra-field">
      <?php print $search['extra_field']; ?>
    </div>
  <?php endif; ?>
?>

Comments

Usha Gavva’s picture

You can create an exposed filter in Views. So that visitors can change the result using filter criteria.

BlackyWhoElse’s picture

Do you want to create a common search bar like the core one ?

If so

<?php
$block = module_invoke('search', 'block_view', 'search');
print render($block['content']);
?>

If you want a autocomplete field thing that filters automaticly your page. I will look for it too

[Suggestion not tested]
Create an Ajax Autocomplete Textfield in your view and set the submit to auto this could be the solution

:D