SnTT: Put Google Site Search Results in the Content pane of BlogSphere
As you are probably aware of, I've been revamping keithstric.com. In that revamp I wanted to add a Google Custom Search (CSE) engine to search only my site. Making the CSE was easy enough with the wizard Google supplies but, I didn't like the way that it either redirected you to a google page or you had to submit the search to another dedicated page on your site. So I set on the quest of getting the results to show up where the content of my website usually shows up. Below I list all the things I tried and then what finally succeeded.
First I tried the default of showing the results on a google hosted page. I just didn't like that at all, I could customize it a little bit but not really.
Next, I tried having the results show up in an article type document, however, the url that gets appended to the search results page starts with "?", seems Domino didn't like this at all and kept dying with an error 500. I tried all sorts of ways to prevent the "?" from being the start of the appended URL to no avail. I did some research on what the subject and it seems when a url contains a "?" Domino expects a domino url extension (i.e. OpenDocument, OpenView or whatever) to come right after the question mark, if it's not what Domino expects, it throws an error 500. To get around it you can create a rewrite rule, but with this blog being hosted by Prominic, I really didn't want to go this route. So, this didn't work...
The last option for displaying the results from a Google Custom Search engine is to display the results as an element. This actually worked with no changes really needing to be made as far as just displaying the results. However, the results just pushed the rest of the blogs content down below the search results. While this worked, I didn't really like it, I think only the search results should show up. But I really liked that the results were "wrapped" within my website. So, how to make it so that when someone performs a search the div which contains the website content is hidden and only the search results are shown? Well, I messed with this for quite a while and never could get it to "really" work. I could hide the div which contained the content but not when the "Search" button was clicked. So I had to post a question over on the Google Custom Search Implementation Forum. The guy that answered didn't leave his actual name, only "omr" is his username and is who really got this to work and who deserves the credit for it.
Now we just need to put this within BlogSphere and we're ready to go. So without further rambling...
- First, setup your CSE to only search your site. When you do this if you go through all the options in the wizard you should find your "CSE ID" which is a long number which basically identifies your CSE.
- Once you get your CSE ID we're ready to put everything in BlogSphere.
Continue Reading...






.



