3 steps for Google Custom Search in a Joomla site

Discuss the integration of Joomla! with other products. ie SMF, phpbb etc etc

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
User avatar
kontaxis
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Nov 28, 2007 10:07 am
Location: Athens
Contact:

3 steps for Google Custom Search in a Joomla site

Post by kontaxis » Wed Nov 28, 2007 10:40 am

Greetings from Greece to all Joomla users!
Just tested an easy way to add a Google Custom Search on a Joomla site: http://www.hybridcars.gr

Only a Static Content Item is requared, for displaying the searched results,
and 3 simple steps, for getting the most powerful search-code in your site!

1) Create a Static Content Item, named for example "Search Results"
- Publish it, in order to see the URL created (write it down) and then unpublish it

2) Copy the URL of the Static Cotent Item at Google Custom Search Engine* |Code|, for where the results are to be displayed.

3) Copy - paste the given code: "Google Box Code" at the place you want the Search Box to appear.
- copy - paste the given code: "Google Result Code" in the Static Content Item you created at 1st step.

This is what I tryed in http://www.hybridcars.gr and worked! (use the search Box at the top-right corner)
Can somebody else try it too, for getting more feedback and suggestions on this subject ?

*to create a Google Custom Search Engine visit: http://www.google.com/coop/cse

computersaidno
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Sun Jan 22, 2006 9:49 pm

Re: 3 steps for Google Custom Search in a Joomla site

Post by computersaidno » Fri Feb 01, 2008 9:19 pm

Thanks for the posting. I like your site.

I tried to follow the instructions. The google code does not output on the front page, it doesn't even show the search box. I switched off html editor.

Which pages did you place the google code in, how did you paste the code, did you unpublish the static code once at step 3?

Thank you.

User avatar
changlee
Joomla! Explorer
Joomla! Explorer
Posts: 369
Joined: Tue Nov 20, 2007 11:05 am
Location: Greece
Contact:

Re: 3 steps for Google Custom Search in a Joomla site

Post by changlee » Fri Feb 01, 2008 9:33 pm

You just have to create a new static  content with Google page results pasted inside.

8)
If you do not programm your life, someone else will do it for you.
Free and low cost Templates at: https://www.b2b-templates.com

User avatar
kontaxis
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Nov 28, 2007 10:07 am
Location: Athens
Contact:

Re: 3 steps for Google Custom Search in a Joomla site

Post by kontaxis » Sat Feb 02, 2008 2:29 pm

Hi, computersaidno. Congratulations for your site!

You want to create a "google search box search" at the frondpage of your site,
searching for contents only in http://www.greenmaven.com , to specific sites or to the entire web?

You must Publish the static content you created, in order the results to be visible.

Let me know if you need any help, I created a Custom google search for your site and worked perfectly.
If you like I can send you the code, but it is better to create it with your account in order to track statistics information.

you can even connect the search results with a adSense account, if you have.
try searching the words "hybrid cars" at my search box at http://www.hybridcars.gr and you see Ads appearing at the left side

crisscross
Joomla! Apprentice
Joomla! Apprentice
Posts: 24
Joined: Thu Dec 15, 2005 6:56 pm

Re: 3 steps for Google Custom Search in a Joomla site

Post by crisscross » Tue Feb 26, 2008 12:33 pm

It seems it only works if you are using some SEF-engine....

User avatar
kontaxis
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Nov 28, 2007 10:07 am
Location: Athens
Contact:

Re: 3 steps for Google Custom Search in a Joomla site

Post by kontaxis » Sat Mar 08, 2008 10:03 am

Also, a google gadget can be designed and publised at google directory for public use !

take a look here: http://gmodules.com/ig/directory?hl=en& ... utput=html

erikas_boy
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Tue Jan 30, 2007 9:09 pm

Re: 3 steps for Google Custom Search in a Joomla site

Post by erikas_boy » Sun Mar 09, 2008 6:00 pm

Hello,
I am trying to make this work on my site
http://www.chrisanderika.com/testing
but everytime I try to implement the search, instead of pointing to the specified page
http://chrisanderika.com/testing/index. ... &Itemid=38
it just bounces back to my front page.

Any ideas/help?

User avatar
kontaxis
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Nov 28, 2007 10:07 am
Location: Athens
Contact:

Re: 3 steps for Google Custom Search in a Joomla site

Post by kontaxis » Sun Mar 09, 2008 6:25 pm

erikas_boy wrote:Hello,
I am trying to make this work on my site
http://www.chrisanderika.com/testing
but everytime I try to implement the search, instead of pointing to the specified page
http://chrisanderika.com/testing/index. ... &Itemid=38
it just bounces back to my front page.
Any ideas/help?
At the control panel of your google custom search, it gives you 2 codes to copy-paste at your site.
- Initially you must specify the RESULT PAGE : http://chrisanderika.com/testing/index. ... &Itemid=38

-then the 1st code must be pasted at the place you want to have the search box appearing,
the 2nd code must be pasted at the page you want the results: http://chrisanderika.com/testing/index. ... &Itemid=38

erikas_boy
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Tue Jan 30, 2007 9:09 pm

Re: 3 steps for Google Custom Search in a Joomla site

Post by erikas_boy » Sun Mar 09, 2008 7:11 pm

Already done. Still bounces to the front page. I can't figure out why. I even tried deleting it all and trying over, but still nothing. Also (while we're on the topic) is there any way to make this work with pages that are for registered viewers only? It doesn't seem so.....

edit: Thanks, by the way for the fast reply. recently I've been finding replies few and far between around here......

pstitalia
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu Feb 07, 2008 8:18 pm

Re: 3 steps for Google Custom Search in a Joomla site

Post by pstitalia » Wed Mar 12, 2008 2:27 pm

I'm having the same issue with the search bouncing back to the frontpage. Has anyone come up with a solution to this?

pstitalia
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu Feb 07, 2008 8:18 pm

Re: 3 steps for Google Custom Search in a Joomla site

Post by pstitalia » Wed Mar 12, 2008 2:58 pm

OK, found it here: http://www.mkbergman.com/?p=311 and here: http://groups.google.com/group/google-c ... 9e771344cd

basically I added hidden input values to manually match the dirty URL in Joomla, which is everything that comes after the ?--> (ex: http://www.xxx.xxx?option=com_content&v ... Itemid=132)

Like so...

<!-- Google CSE Search Box Begins -->
<form action="http://xxx" id="searchbox_xxx:xxx">
<input type="hidden" name="option" value="com_content">
<input type="hidden" name="view" value="article">
<input type="hidden" name="id" value="61">
<input type="hidden" name="Itemid" value="132">

this works!!!

User avatar
kontaxis
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Nov 28, 2007 10:07 am
Location: Athens
Contact:

Re: 3 steps for Google Custom Search in a Joomla site

Post by kontaxis » Wed Mar 12, 2008 5:18 pm

Great work "pstitalia" ! :D

erikas_boy
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Tue Jan 30, 2007 9:09 pm

Re: 3 steps for Google Custom Search in a Joomla site

Post by erikas_boy » Wed Mar 12, 2008 8:00 pm

Brilliant, thanks a million. That worked perfect.

User avatar
erickaps
Joomla! Intern
Joomla! Intern
Posts: 98
Joined: Thu Aug 17, 2006 9:27 am
Location: United Kingdom
Contact:

Re: 3 steps for Google Custom Search in a Joomla site

Post by erickaps » Fri Mar 28, 2008 12:40 pm

Nice work "pstitalia".

Got this working very nicely here http://www.ingenious-resourcing.com/ind ... iew/37/43/ using two different customer searches and a standard internal site search.

ThePiston
Joomla! Guru
Joomla! Guru
Posts: 640
Joined: Mon Nov 07, 2005 3:45 am
Contact:

Re: 3 steps for Google Custom Search in a Joomla site

Post by ThePiston » Wed May 14, 2008 7:41 pm

I'd like to expand a little on this, cause it drove me nuts for about 2 hours:

This method works, but watch out for your actual link, this is mine:
domain.com/index.php?option=com_content&task=view&id=42&Itemid=49

you are concerned with just the stuff after the "?" - broken down, it's this:
option=com_content
task=view
id=42
Itemid=49


So, my code went from this:

Code: Select all

    <input type="hidden" name="cx" value="XXXXXXXXXXX" />
    <input type="hidden" name="cof" value="FORID:10" />
    <input type="text" name="q" size="20" />
    <input type="submit" name="sa" value="Search" />
To this:
<input type="hidden" name="cx" value="XXXXXXXXXXX" />
<input type="hidden" name="cof" value="FORID:10" />
<input type="hidden" name="option" value="com_content" />
<input type="hidden" name="task" value="view" />
<input type="hidden" name="id" value="42" />
<input type="hidden" name="Itemid" value="49" />
<input type="text" name="q" size="20" />
<input type="submit" name="sa" value="Search" />

As you can see for each abc=xyz statement in the link, you need the same input values in your code as well. The bold is custom stuff you need to figure out and the red letters are things you definitely need to change according to your content id #s.

kksou
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Sun Mar 30, 2008 10:34 am

Re: 3 steps for Google Custom Search in a Joomla site

Post by kksou » Fri May 16, 2008 2:04 am

Hi,

I've just released a googleSearch component that allows you to easily add a Google Search to your Joomla site:

http://extensions.joomla.org/component/ ... Itemid,35/

Set up is as easy as 1-2-3:
1. Install the component
2. Enter your Google Adsense ID
3. Enter your desired width of the search result

That's all you need to get started!

Of course there are other advanced settings that allow you to customize the Google Search to suit your needs.

omarseverino
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Apr 28, 2008 8:24 pm

Re: 3 steps for Google Custom Search in a Joomla site

Post by omarseverino » Wed Jun 11, 2008 6:46 pm

I'm interested in buying the Joomla template that is being used at:

http://www.greenmaven.com

Regards,

CSE@Dominicana.com
http://www.dominicana.com

sw_hel
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Sun Mar 18, 2007 3:31 pm

Re: 3 steps for Google Custom Search in a Joomla site

Post by sw_hel » Fri Jun 13, 2008 6:37 am

im trying to geth this working to i goth the search button upp and the results page buth its emty no results on it. what is wrong. loke here www.kollon.se

marilah
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sat Jun 14, 2008 9:01 am

Re: 3 steps for Google Custom Search in a Joomla site

Post by marilah » Fri Aug 22, 2008 1:23 pm

I get a blank search result. My url doesn't have the ItemId.

http://www.site.com/index.php?option=co ... icle&id=51

To create static item, I just follow this instruction http://nyjoomla.wordpress.com/2008/02/2 ... tent-item/ which basically suggest one to create a new Article and select Uncategorized. I am using Joonla 1.5.3.

Any suggestion how to make this work?

Arjun Arya
Joomla! Intern
Joomla! Intern
Posts: 59
Joined: Tue Sep 25, 2007 2:44 pm

Re: 3 steps for Google Custom Search in a Joomla site

Post by Arjun Arya » Fri Jan 09, 2009 11:31 am

Same here....

Joomla 1.5.8, getting a blank page.

Dont quite understand by how to put the google search result code in the static page . . . has it to be written on the page like any text or in the HTML of the page ?

In both cases, i also get a blank page.

Since my page does not have these 4 values -

<input type="hidden" name="option" value="com_content" />
<input type="hidden" name="task" value="view" />
<input type="hidden" name="id" value="42" />
<input type="hidden" name="Itemid" value="49" />

My URL is this -

index.php?option=com_content&view=article&id=308

So I did this -

<input type="hidden" name="cx" value="partner-xxxxxxxxxxxxxxxxxxxxx" />
<input type="hidden" name="cof" value="FORID:11" />
<input type="hidden" name="option" value="com_content" />
<input type="hidden" name="view" value="article" />
<input type="hidden" name="id" value="308" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" size="20" />
<input type="submit" name="sa" value="Search" />

Can anyone please suggest ?

Thanks,

AA.

User avatar
Mikunda
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Sep 03, 2009 3:04 pm

SOLUTION J2.5: Steps for Google Custom Search in a Joomla si

Post by Mikunda » Thu May 17, 2012 4:18 pm

Hi there,

Wanted to share how I did it for a Joomla 2.5 Site. Looks like a lot of steps because it is super detailed, in fact it is quite simple - takes 3 minutes to implement:

1. Purchase your Custom Search license.
2. Once activated, go to your Search Console, select Control Panel, which is next to your Custom Search Name
3. Click the Control Panel
4. Once you are in, from the column on the left, find "Get Code"
5. You will be given 2 codes - one for your Search module, which you set up this way:
- Go to modules, create a custom HTML Module, publish in your Search position, paste the code above that was provided by Google for your search "box". (don't forget to "toggle editor" and paste in HTML view.)
- Optional: You might need to uncomment the <input type="submit" name="sa" value="Search" /> to hide the Search button and only keep the input form; you can also modify the search box width by editing this number here<input type="text" name="q" size="31" />.
- Disable your Joomla Search Module
6. To use the second code:
- Create an Article in your "Uncategorized" article category. Name it "XYZCompany Search Results"
- Paste the Google code provided for this page in the article (don't forget to "toggle editor" and paste in HTML view.)
- Save.
- Go to Hidden menu
- Create new menu item " Search results" and link to your newly created search article.
7. Optional:
- Copy-paste the code from the module, place above the code in the article. This way you will have a nice search results page with a nice search form on top of it. I would add 1-2 <br/> to create a break between the two.
8. Test - should be working fine.

Mbit
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 126
Joined: Wed Mar 17, 2010 7:46 am

Re: 3 steps for Google Custom Search in a Joomla site

Post by Mbit » Tue Nov 20, 2012 8:13 am

Hello Mikunda, can you give me some details?
Mikunda wrote:Hi there,

Wanted to share how I did it for a Joomla 2.5 Site. Looks like a lot of steps because it is super detailed, in fact it is quite simple - takes 3 minutes to implement:

1. Purchase your Custom Search license.
2. Once activated, go to your Search Console, select Control Panel, which is next to your Custom Search Name
3. Click the Control Panel
4. Once you are in, from the column on the left, find "Get Code"
5. You will be given 2 codes - one for your Search module, which you set up this way:
- Go to modules, create a custom HTML Module, publish in your Search position, paste the code above that was provided by Google for your search "box". (don't forget to "toggle editor" and paste in HTML view.)
the code i copy has 2 lines of comments where one says to past this before </head>, we dont put it before </head> ?
- Optional: You might need to uncomment the <input type="submit" name="sa" value="Search" /> to hide the Search button and only keep the input form; you can also modify the search box width by editing this number here<input type="text" name="q" size="31" />.
- Disable your Joomla Search Module
6. To use the second code:
- Create an Article in your "Uncategorized" article category. Name it "XYZCompany Search Results"
- Paste the Google code provided for this page in the article (don't forget to "toggle editor" and paste in HTML view.)
- Save.
- Go to Hidden menu
- Create new menu item " Search results" and link to your newly created search article.
What kind of menu is that? a link to the article? If so how do you connect the module with that article results?
7. Optional:
- Copy-paste the code from the module, place above the code in the article. This way you will have a nice search results page with a nice search form on top of it. I would add 1-2 <br/> to create a break between the two.
8. Test - should be working fine.
Buy Medical Supplies, Medical Equipment and Home Health Care products: http://www.medi-shop.gr/en


Locked

Return to “Integration & Bridges - 1.0.x”