Thursday, December 11, 2008

Tips for Google CSE plugin for Drupal

Drupal, there are a few things you can do to make life easier for your visitors:
Add some rewrite rules (to the .htaccess file) to redirect requests for the old search engine to the new one. This can help visitors who know how Drupal works and were typing their search manually, etc.

RewriteRule ^search$ /search/google [R=301,NC,L]
RewriteRule ^search/node$ /search/google [R=301,NC,L]
RewriteRule ^search/node/(.*)$ /search/google?query=$1 [R=301,NC,L]
RewriteRule ^search/taxonomy_search$ /search/google [R=301,NC,L]
RewriteRule ^search/taxonomy_search/(.*)$ /search/google?query=$1 [R=301,NC,L]
Disable the built-in search engine module to reduce memory overhead and speed up page requests.

Use some CSS to hide the background image added to the search boxes:
input.form-text {
background-image: none !important;
If you have custom search boxes replace them with code that calls the Google CSE engine, i.e.:

Put together this can make the GoogleCSE almost(*) completely transparent to your visitors.

Read More..

No comments: