Search box in the header of a template
I've looked around trying to find a simple solution to this but not had much luck!
Does anyone know the code to put in the header.php file of my template so i get a search box on the site. I would also like this search box's results to link to another results page?
Any ideas anyone? thanks for looking!
How do I get the search input box in the header on each page on the site?
Thanks for your replies so far!
> box and put it in my header
Of course it is. You can hard code a block into your template, but the way I did it was to add a search block to the global scrapbook and then incorporate it into my header.php view template as follows...
<div class="search"><?php $b = Block::getByName('Site Search Field'); if( is_object($b) ) $b->display(); ?> </div>
> and for it to return results onto another page?
That's an option in the search block configuration dialog.
So if I create a search block add it to my global scrapbook then add the above code into my header it should work?
How do I change the styling of the search box.
I would like to get rid of the Search Title and add some CSS styling to the input box?
thanks for looking
This is a slightly better link:
In summary though - copy the /concrete/blocks/search folder to /blocks/search and you can then update the view.php file and the view.css file. Or create a completely new skin under blocks/search/templates/skin_name.php
<div id="my_search_block_id_or_whatever"> <?php $sb = new Area('Search Block'); $sb->display($c); ?> </div>
Then simply add the search block from within Concrete5's "edit mode". That's all!