Custom Search Engine (CSE) Search Box Height.

2,417 views
Skip to first unread message

mike365

unread,
May 25, 2010, 9:01:54 PM5/25/10
to Google AJAX APIs
Is there any way to adjust the Custom Search Engine (CSE) Search Box
Height?

Jeff S (Google)

unread,
May 26, 2010, 1:23:28 PM5/26/10
to Google AJAX APIs
Hi Mike,

Yes there are a few ways that you could do this. One way would be to
write your own CSS rule which overrides the defaults for the CSE. The
search box has the class "gsc-input" so you could do something like
this

http://savedbythegoog.appspot.com/?id=777d79be871a371ba500837e2e54aafafd992822

You can also create your own input box and tell the CSE to use that
instead by using a draw option, though this does change the default
behavior of the search box. More details here:

http://code.google.com/apis/ajaxsearch/documentation/reference.html#_method_GdrawOptions

I'm guessing you probably just want to go the CSS route.

Happy coding,

Jeff

Jeremy Geerdes

unread,
Jan 28, 2013, 11:49:52 PM1/28/13
to google-ajax...@googlegroups.com
If you're doing what I think you're doing (i.e., hosted Custom Search widget in an iframe on your Google Site), there's no real way you can do this. If that's not what you're up to, you'll need to post a link so we can take a look.

jg

On Mon, Jan 28, 2013 at 6:24 PM, Justin Eakins <j.eak...@gmail.com> wrote:
Jeff,

How do you adjust the CSS of the results page? I want to make the height dynamic so that it stretches to the end of my results. (I have mine as a gadget on my Google Site and I can't find anything on how to dynamically adjust the height on the gadget) If I could just make it have the option to have 100% height or something - that would be nice.

--
--
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
google-ajax...@googlegroups.com
To unsubscribe from this group, send email to
google-ajax-searc...@googlegroups.com
To view this message on the web, visit
https://groups.google.com/d/msg/google-ajax-search-api/-/ndqe-K9f-WkJ

For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-ajax-searc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Jeremy R. Geerdes
Generally Cool Guy
Des Moines, IA

If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!

Justin Eakins

unread,
Jan 29, 2013, 12:23:15 AM1/29/13
to google-ajax...@googlegroups.com
Thanks for the response. What I did was save the XML file for the code that the CSE page gave me on a notepad document. Then I uploaded it to the attachments section of the Google Site's > Manage Sites > Attachments > Upload. Once uploaded I right clicked on Download then copied the URL. Then I edited a page > Clicked on Insert > More Gadgets then added my gadget by URL. It takes up the entire page width wise, but I can't figure out what to edit on the XML. 

I can adjust the pixels to make it around 800px in height, however before I start a search I have 600px of white space before the footer of my site. Is there anything in this code below that I can add to make it have a dynamic height that expands only when they do a search, but not on the homepage.

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
  <ModulePrefs title="PDF Search" />
  <Content type="html">
    <![CDATA[
      <script>
  (function() {
    var cx = '001428116054185302584:zkwyutgabn0';
    var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true;
    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
        '//www.google.com/cse/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s);
  })();
</script>
<gcse:search></gcse:search>
    ]]>
  </Content>
</Module>​

Regards
Reply all
Reply to author
Forward
0 new messages