Search box in the header of a template
Permalink
Hi,
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!
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!
this functionality is included in the search block and you have the option with it to post results to a seperate page.
thanks for your reply.
How do I get the search input box in the header on each page on the site?
How do I get the search input box in the header on each page on the site?
for current pages you can't but for new pages you ccan. go to dashboard, themes, page types, and next to the page types you want to modify click on defaults.
so its not possible to take the search input box and put it in my header and for it to return results onto another page? I want the search box hardcoded into the actual template not in a block as such
Thanks for your replies so far!
Thanks for your replies so far!
you could try with forms, don't know if itll work though.
> so its not possible to take the search input
> 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...
> and for it to return results onto another page?
That's an option in the search block configuration dialog.
-Steve
> 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.
-Steve
Thanks for your replies.
So if I create a search block add it to my global scrapbook then add the above code into my header it should work?
Thanks again
So if I create a search block add it to my global scrapbook then add the above code into my header it should work?
Thanks again
yeah that should work
I've managed to add this now, thanks for that code.
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
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 should answer your question...
http://www.concrete5.org/documentation/general-topics/custom-templa...
Jon
http://www.concrete5.org/documentation/general-topics/custom-templa...
Jon
Actually, just read through the page and it actually just tells you what custom templates are, not how to build them. My bad...
This is a slightly better link:
http://www.concrete5.org/documentation/developers/blocks/directory-...
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
Jon
This is a slightly better link:
http://www.concrete5.org/documentation/developers/blocks/directory-...
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
Jon
Simply add this into the place in the header.php where you want your search block.
Then simply add the search block from within Concrete5's "edit mode". That's all!
<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!