Allow a third display option: display on site without JavaScript/frames

jhodgdon - December 17, 2008 - 18:52
Project:Google Custom Search Engine
Version:5.x-1.6
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

If you get a "business" (paid) account on Google Custom Search, you are allowed to get search results via XML and display them in your site however you want, without ads, and without using JavaScript or iFrames.

I have successfully modified your google_cse module so that it can do this. Probably other sites would find this useful, so I thought I'd file a Feature Request with my changes.

I can attach a patch if you want, but there are so many changes I thought it might be simpler just to attach the rewritten module itself. Besides making this new display option, I also added a bunch of other options to the Settings page that allow you to customize more of the text in the output of the module. And since there were now a lot of options, I rearranged the options screen (added some more fieldsets and changed the order of some fields).

I will also attach a few lines to be added to the CSS file for the new display option.

I did this for a Drupal 5 site, so I have only done this for the Drupal 5 version of your module, but it would probably be good to do it for Drupal 6 as well. Feel free to use the code as you see fit, and let me know if you'd like the patches in a different format.

AttachmentSize
New version of 5.x module, with option to display results in site without JavaScript25.6 KB
CSS additions for new version of module111 bytes

#1

msteudel - February 3, 2009 - 21:22

Any chance to get this integrated? This is a great third option.

#2

samc - February 22, 2009 - 18:54

I was hoping the CSE module did this, and am very glad to find this patch. I'd love to see it integrated in as well.

#3

mfb - February 25, 2009 - 22:33

A patch on drupal-6 would be preferred, otherwise I'll have to do a lot of work to integrate this.

#4

samc - February 26, 2009 - 00:09

I've been playing with the XML feature and it works great.

In addition, I've further modified the code posted above to support the use of GCSE's labels and refinements. I.e. the "Refine your search for 'blah'" features.

I'm happy to share what I've got with anyone interested. I wasn't sure it made sense to post a patch against a patch, but once the base XML feature is integrated in I'd be happy to roll something.

#5

mfb - February 26, 2009 - 00:11

Rather than posting a patch of a patch, just reroll the patch. But it also needs to be rerolled for d6.

#6

jhodgdon - February 27, 2009 - 20:01

Sorry - my client's site was started a while back and was using D5, so that is why the patch is for D5.

#7

redping - September 14, 2009 - 16:06

Is this change available for drupal 6 module? I only see that you can choose where you want the ads to be displayed and I don't see an option for using a business account

 
 

Drupal is a registered trademark of Dries Buytaert.