Community Documentation

v3 Knowledgebase

Add Google Search To Your Site

To add Google Search to your site do the following:Step 1:Go to your adminCP and create the page that you want your search results to appear in.
Step 2: Go to google and create an adsense account if you don't alread have one. Once you create your account, create an "adsense for search" search bar and in the box where it says: ENTER URL WHERE SEARCH RESULTS WILL BE DISPLAYED, enter the exact path to the page you created in step 1. Finish the setup process and copy the code generated for you and put it aside.
Step 3:Open Template.html.php from your AdminCP
Step 4UnhappyOPTIONAL)
For those of you that don't want 2 search boxes on your site, just go to your template.html.php file and find:

{block location='8'}

{block location='5'}

and add the following after it:

and put your google search bar code that you created from step 2 in between these div's.

Step 6:

Go to you layout.css file and at the very end put the following:.googlesearch
{ width:300px;
top: 4px;
right: 15%;
padding:0 10px 1px 12px;
This will place the google search bar at the very top of your site, which is where I wanted mine. If you want it in another location, you must alter the Top: , Right: , parts of the code above. So for example mine is 4px from the top and 15% from the right. I think it's better to use percent so that no matter how big the person's monitor is it will look the same to them.
If you removed your original search bar from step 4, now all you have to do is just go to the admincp and create a menu for your site's default search page which will be different from your google search page. so your menu should point to , now member's can click on this button to reach your default search page and search your site or they can use your new newly created google search bar to search your site or the entire web, based on your preferences, all without leaving your site. This works great on my site, as always backup your files before altering them just in case you make a mistake.
*****Edit*****The difference between doing it this way and simply pasting the google code in your designated ad spaces or blocks is that you can place the search bar pratically anywhere on your site, exactly where you want it.