Thix extention is created thanks to this: http://tutorialzine.com/2010/09/google-powered-site-search-ajax-jquery/
With this widget you quickly add a searchfield to your site.
- User searches on either your site or on the entire web.
- Web,image,news,video search types
- Uses Google as search engine
- Hits are shown via ajax, "more" button to load more results
- Fully Customizable css
- Easy to install
Tested with Yii 1.10 in firefox, should work on all platforms though.
- Unpack the files to protected/extentions/search.
Your dir-structure should now be:
- EDIT protected/extentions/search/assets/js/google_search.js Change line 3:
siteURL : 'YOUR_SITE_URL', // Change this to your site url
Optional: Style the widget in protected/extentions/search/assets/css/google_search.css You can change everything if you want to.
Place this code in a view:
DONT FORGET You have to clean your app/assets folder after making changes to the js or css files.
I will give it a try this is what I have been looking for.
Awesome extension, thanks a lot mate!
something is missed
nice integrating with Yii, but it really would be better if you've mentioned the real source from which you take the code! ;)
and as it is mentioned on the original post's comments, this Google API is deprecated, if anyone knows how to use new API with this platform, let us know !
I am so sorry, I wrote it in the readme.txt included in the download, I thought I wrote the same here.
Updated the text here now:)
I only found that tutorial, like it, made a yii widget wrapper around it,changed it some to spare people some time to do the same themselves:p
If you check my other contributions you would see I'm always giving the original author full credit:p
About the api, this script still works, so why is it a problem?:)
thank you for updating this page :) I knew it was just missed and you forgot to mention it, not anything else !
about the API, the problem is that we are not sure about correct and reliable functionality, for example there may be a limit for amount of search requests per day.
actually i've used this search in one of my projects, but this project is not deployed yet, so i cant tell if it works well or not, I'll let everyone know when I find out.
You are limited to 8 pages of 8 results (64 in total), however if your website is well optimised, your user's shouldn't need any more than that.
A little addition for your JS file, should you need it:
var cursor = r.responseData.cursor;
settings.term = settings.term || $('#search').val();
I also suggest putting the un-escaped URL in the results too, this is a small change at the bottom of the .js file:
sorry if this is a lengthy comment, just thought you guys could benefit being shown around the code a bit :)
Not enough information
Hi, I think this ext could be awesome. But the author did not give any detail for the extension, I just do like readme.txt and nothing happen! Moreover, the author did not answer in the extention' forum! Why?
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.