Add-on Google Custom Search

ForestForTrees

Well-known member
Hi @melbo, this looks terrific!

I'm off to visit my little brother "in Googleland," tomorrow for a week, but I'll make an official resource when I get back. I plan to keep it as an "open source" style project with an MIT license.

With your permission, I'd love to add your graphic. It looks great.
 

melbo

Well-known member
Sure although I'm using the second graphic now which is probably way too large but it looks better.
 
N

Nelson T.

Guest
I tried doing this in VB, and it was a BEAR. I would love to see you get this going as an addon Forest!!
 
The original link on the first page describing what the modifications were based on is now dead, can you give me a loose outline of what templates are edited in total?

By the way as for the retina image above, I've been using "srcset" and a JS polyfill to serve responsive images on our site at different sizes for several months now. I have to process and cache the various sizes, but it's working well, only bit left is to run the cached images through a loseless compressor, but I'm working on that. Try Honda Karma on various x2, x3 and x4 resolution devices :)
 

jacko

Well-known member
Do you know how I can make the google search work with 3 character words when my server minimum is 4 characters?
 

jacko

Well-known member
I have always found that Google doesn't have a minimum
Yes, but the template modification from this thread won't even show google results if the search query is below Xenforo's minimum or Xenforo's search results are empty.
 

kankan

Well-known member
Dressed up the tab a bit with an image (.png with transparent background)

View attachment 96868

I followed the above instructions (which could really be cleaned up a bit :) ) to get this far.


Upload an image (example attached below) to your /images/ directory.
In template search_results, find:
Code:
<xen:if is="{$search.search_query} AND {$page} < 2">

<ul class="tabs Tabs" data-panes="#xfgcs_Panes > li">
     <li><a href="{xen:link search, $search}#xf">Results from our forum only</a></li>
     <li><a href="{xen:link search, $search}#gcs">YOU PROBABLY CUSTOMIZED THIS TEXT</a></li>
</ul>
and replace it with this:
Code:
<xen:if is="{$search.search_query} AND {$page} < 2">

<ul class="tabs Tabs" data-panes="#xfgcs_Panes > li">
<li><a href="{xen:link search, $search}#xf">Results from our forum only</a></li>
<li><a href="{xen:link search, $search}#gcs"><img src="/images/google-cse-logo.png" alt="Google Custom Search" style="width:120px;height:21px"></a></li>
</ul>
You can see how it looks live with this sample search: https://www.survivalmonkey.com/search/1385414/?q=water&o=date

edit: I just realized my image looks pretty rough on retina screens. I'd tried to optimize it to be small but may have ruined it. If any graphics folks can do better, please share :)
Hi
Undigging...
Facing the same error on my site than in yours :
Unauthorized access to internal API. Please refer to https://support.google.com/customsearch/answer/4542055


EDIT : solution here :
https://xenforo.com/community/threads/reckons-team-google-custom-search-deleted.95820/page-16#post-1199151
 
Last edited:
Top