Jump to content
Latest News: (loading..)
Sign in to follow this  
JcMagpie

Support thread for Google Custom Search addon for CE

Recommended Posts

A simple header that installs the Google Custom Search box to your site header. This will give you a nice Modal search pop up window.

You will need to have a google account to get the custom search code. The code can be made to limit search to within your site only.

You can get your code from here  https://cse.google.co.uk/cse/

Once you have your code simply edit “tpl_cm_jcm_google_search.php” and add you code as marked.

<!------------------add your Google Script below this line------------------>    
    
     <script>
  (function() {
    var cx = '007037419634106605348:gua56w345ta';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
  })();
</script>
<gcse:search></gcse:search>

<!------------------add your Google Script above this line------------------>

 

 

The code supplied is for the test site https://justfastfood.com/

You can see the addon working on the site.

image.thumb.png.5942ae701f78fb1f5f29cd069b11a2b7.png

Search output is on pop up Modal window.

image.thumb.png.0cdf990367d20673a83c9374a51cb86e.png

 


 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×