Is anyone using a google search box on their site? My attempt isn't working

rated by 0 users
This post has 11 Replies | 3 Followers

UtahJones
Top 500 Contributor
Posts 62
Points 970
By: UtahJones
Posted: Wed, May 31 2006 7:57 PM

Is anyone using a google search box on their site? My attempt isn't working. I placed the google search box code in the footer inline ad area. When I enter search text in the google search box it simply takes me to the CS advanced search area.

 

 

David
 
  • Post Points: 20 |
Dave
Top 10 Contributor
Posts 2,307
Points 14,730
MVPs
By: Dave
Posted: Thu, Jun 1 2006 4:40 AM In reply to
You need to place the search code in it's own page and embed it in CS using an IFRAME, have a look at the code on the homepage of www.uk-mkivs.net
 
  • Post Points: 50 |
UtahJones
Top 500 Contributor
Posts 62
Points 970
By: UtahJones
Posted: Thu, Jun 1 2006 10:57 AM In reply to

Thanks for the solution! I love your site - it looks great. Great job. I'm still working on my site and thought it was done, but yesterday but I started looking at it on Dell 19" monitors and I was dismayed. The colors were washed out and not vibrant even with default factory settings. I'm wanted to use a toned down color scheme that fits my site for Arizona gardening but on the larger monitors it didn't stand out.

On my Dell 17" and it looks like I intended from a design/color standpoint. I'm still testing other browsers too.

I might have a couple of questions for you down-the-line...

David
 
  • Post Points: 5 |
UtahJones
Top 500 Contributor
Posts 62
Points 970
By: UtahJones
Posted: Thu, Jun 1 2006 12:08 PM In reply to

This is the google code they gave me for the search box:

<!-- Search Google -->
<center>
<form method="get" action="http://www.google.com/custom" target="google_window">
<table bgcolor="#ffffff">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">

<input type="text" name="q" size="31" maxlength="255" value=""></input>
<input type="submit" name="sa" value="Google Search"></input>
<input type="hidden" name="client" value="pub-4540028856158828"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;"></input>
<input type="hidden" name="hl" value="en"></input>
</td></tr></table>
</form>
</center>
<!-- Search Google -->

I would like to be able to add it to the inline ad control at the bottom of the page so that a google search option is available on every page the ads are displayed. The general footer area won't work because I have other content there.

Thanks for your help!

David
 
  • Post Points: 20 |
Leo
Top 150 Contributor
Posts 148
Points 1,490
By: Leo
Posted: Mon, Jul 31 2006 10:53 AM In reply to
Did you find a solution other than the iFrame to integrating the Google search box on your site?

 

 
  • Post Points: 35 |
Dave
Top 10 Contributor
Posts 2,307
Points 14,730
MVPs
By: Dave
Posted: Mon, Jul 31 2006 10:57 AM In reply to

Leo:
Did you find a solution other than the iFrame to integrating the Google search box on your site?

This is the only solution, there's no other way of embedding a form within an ASP.NET form (as far as I know Big Smile).

 
  • Post Points: 20 |
Presstopia
Top 500 Contributor
Posts 50
Points 820
By: Presstopia
Posted: Thu, Aug 17 2006 11:28 PM In reply to

Try something like this :

--------------------

<script language="JavaScript">
  function GoogleSearch(q) {
    window.location = "http://www.google.com/custom" +
    "?q=" + q +
    "&domains=Presstopia.Com" +
    "&client=pub-5574270870679096";}
</script>
<input type="text" name="q" size="20" maxlength="255" value="" />
<input type="button" name="sa" value="Search" class="button" onclick="GoogleSearch(q.value);" /><br/><br/>

--------------------

It basically uses the button onclick event to submit the form.

 

 
  • Post Points: 20 |
Dave
Top 10 Contributor
Posts 2,307
Points 14,730
MVPs
By: Dave
Posted: Fri, Aug 18 2006 4:45 AM In reply to
Is it not against the Google T&C's to do that though?
 
  • Post Points: 20 |
Presstopia
Top 500 Contributor
Posts 50
Points 820
By: Presstopia
Posted: Fri, Aug 18 2006 1:29 PM In reply to

Dave:
Is it not against the Google T&C's to do that though?

Not sure - I think as long as you're not trying to mask the fact that you're using Google for searches, and you're not "tricking" the user into performing searches, it should be fine. The above method is just a way to achieve the same result as a form, but without the form element. Might want to check with Google though just to make sure ...

 
  • Post Points: 20 |
Dave
Top 10 Contributor
Posts 2,307
Points 14,730
MVPs
By: Dave
Posted: Fri, Aug 18 2006 2:50 PM In reply to
Your method is preferrable for CS definitely as you cannot embed iframes inside contentparts, you may be able to do so in adparts though
 
  • Post Points: 5 |
storkbite
Top 500 Contributor
Posts 85
Points 970
By: storkbite
Posted: Wed, Aug 23 2006 8:20 PM In reply to
Wow, Dave.  That sounded sorta complicated, but you provided the complete solution. Thanks for sharing with us. Smile
 
  • Post Points: 5 |
Trevor_B
Not Ranked
Posts 13
Points 200
By: Trevor_B
Posted: Mon, Oct 23 2006 3:50 PM In reply to
Dave:

Leo:
Did you find a solution other than the iFrame to integrating the Google search box on your site?

This is the only solution, there's no other way of embedding a form within an ASP.NET form (as far as I know Big Smile).

 

In ASP.NET 2.0, you are able to change the post to URL of any form submit/button on a page.

 
  • Post Points: 5 |
Page 1 of 1 (12 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com