Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization:
Google custom search
mapyaboy



Joined: 14 Aug 2006
Posts: 600

Posted: 05/13/12 12:11 
I am trying to add the google custom search box on my site. I have a template for the results as search_result.tpl Google adsense provides this code to add to where you want your results displayed which is
search_results.tpl

Code
<div id="cse-search-results"></div>
<script type="text/javascript">
  var googleSearchIframeName = "cse-search-results";
  var googleSearchFormName = "cse-search-box";
  var googleSearchFrameWidth = 800;
  var googleSearchDomain = "www.google.com";
  var googleSearchPath = "/cse";
</script>
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>

And the code for the searchbox

Code
<form action="http://www.mysite.com" id="cse-search-box">
  <div>
    <input type="hidden" name="cx" value="partner-pub-xxxxxxxxxxxxxxxx:xxxxxxxxxx" />
    <input type="hidden" name="cof" value="FORID:10" />
    <input type="hidden" name="ie" value="UTF-8" />
    <input type="text" name="q" size="50" />
    <input type="submit" name="sa" value="Search" />
  </div>
</form>

<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang="></script>

But when I search with the box it directs me to the index page with this long url

Code
http://192.168.220.128/mysite/index.php?cx=partner-pub-xxxxxxxxxxxxxxxx%xxxxxxxxxx&cof=FORID%3A10&ie=UTF-8&q=trucks&sa=Search&siteurl=192.168.220.128%2Fmysite%2F&ref=192.168.220.128%2F

What do I add to the htaccess file to have the url work with sefjam_htaccess and the search form to work

Back to top
Dazed



Joined: 22 Mar 2006
Posts: 4147

Posted: 05/13/12 15:41 
Try this..


<div id="cse-search-results"></div>
{literal}<script type="text/javascript">
var googleSearchIframeName = "cse-search-results";
var googleSearchFormName = "cse-search-box";
var googleSearchFrameWidth = 800;
var googleSearchDomain = "www.google.com";
var googleSearchPath = "/cse";
</script> {/literal}
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>

Back to top
mapyaboy



Joined: 14 Aug 2006
Posts: 600

Posted: 05/13/12 17:51 

Dazed:
Try this..


<div id="cse-search-results"></div>
{literal}<script type="text/javascript">
var googleSearchIframeName = "cse-search-results";
var googleSearchFormName = "cse-search-box";
var googleSearchFrameWidth = 800;
var googleSearchDomain = "www.google.com";
var googleSearchPath = "/cse";
</script> {/literal}
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>


this didn't fix it.

Back to top
mapyaboy



Joined: 14 Aug 2006
Posts: 600

Posted: 05/21/12 22:38 
Am still trying to fix this, can it be the SEF URLs causing the problem?

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.