View Gerard's plugins
This plugin will add google custom search to your site. Google will only display search results from your site and not the rest of internet.
The plugin will not replace default search, only the search bar on top of every page.
You can still use default search for tags and other stuff, which I personnaly like very much. Google is however much better in providing results that people are actually searching for.
This plugin is especially usefull for larger sites with a lot of content, users and pages The search result view is wrapped in a normal site page view, so it keeps your own site look and feel.
- Download zip and and drop content in /mod
- Register your custom site search at http://www.google.com/cse
- Copy the generated google code in settings
- Removed creation of menu item since it is useless.
Hi Gerard, Thanks for your plugin! It looks great on your website. I was just wondering if the generated google code is supposed to be comprised of the Search Engine ID with number and letter combinations, or is it the HTML code generated? I've put in the Search Engine ID, but all results come up empty. If i try to put in the html code, i get the following error: "You don't have permission to access /elgg/action/plugins/settings/save on this server."
I have attempted to modify the permisions of the settings/save file to 7 5 5 but still unable to save.
Do you have any points on what i should try to do to fix it?
This probably has nothing to do with the google search plugin, but as you guessed with the rights on your system.
I am not sure if it is a typo, but the actual file that is used in the engine to save settings is actions/plugins/settings/save.php
Try setting 755 as the rights of the whole system and check that your apache user is at least group owner.
If this doesn't help check, if you can change settings of other plugins.
What you actually have to enter in settings is below: (the actual value in var cx is provided to you by google CSE)
var cx = 'code-provided-by-google-cse-for-your-site';
var gcse = document.createElement('script');
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script');
I wonder is there an easy way to say use the regular search but to put this search page on the bottom or top of the regular search results page letting users know that they can try this instead? Or maybe just to put the Google custom search right above or below the regular search. It might look a little strange strange but it would provide maximum search capabilities to the user and allow them to choose. :)
@GTS fan9. Currently it uses both search engines. Elgg for tags, google for the rest.
It is possible to provide users both searches in different search boxes, you only need to define another search box in the header. The query URL for google is /google?q= and for elgg is /search?q=
To be honest, I don't think users like two search boxes, since it is confusing.