Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...DNN and Google CSEDNN and Google CSE
Previous
 
Next
New Post
10/24/2008 9:12 PM
 

First, I want to thank the DNN team and this strong community for helping to develop and provide such a great, versatile tool!

Now, the problem ;-)

I am a Google AdWords publisher and would like to use a Google Custom Search Engine for my internal searches.  Motivation here should be obvious - I'm trying to make a little extra cash on ad clicks, and if those are generated on the search results page in addition to my existing AdSense blocks, then so much the better.  Hey, maybe I could even afford to buy some of these nifty modules!

So.  DNN has this great lil internal search engine that provides site search, and also a radoi button option to search the web using google.  Two problems:

1) The web-wide search results open in a popup window.  Since both the major browsers now block popup windows by default, this presents a problem - I honestly thought the thing was broken in Firefox until I tried it in IE and got the more obvious notification of a blocked popup.

2) Rather than containing web-wide results in my site, I'm pushed out to a more-or-less 'standard' Google search results page.  I would much prefer whenever possible to keep eyes and clicks on my pages (even if that's "my page surrounding a Google CSE IFrame).

What I'd like to do is modify the search functionality so that it queries my designated results page, rather than Google.Com, and displays those results within my framework.

Problem is, I haven't the foggiest clue as to where I'd start - I can't even find a target page to send the search query to, let alone confidently tracking down the search code and modifying it to fit my needs.

Would appreciate any available help with this...and please be gentle, I'm just moving in to ASP.Net development after many years as an ASP developer, and I definitely don't have my head around all the inner workings of things yet.

Many thanks!

John Henry

 
New Post
11/19/2008 10:58 AM
 

I also was motivated to find a way to display Google Search results within my own DNN pages instead of a separate page.  There are a couple of ways to do this: (1) use your own code to query Google search "behind-the-scenes" and then parse and display the results yourself in your page, or (2) simply use Google's new AJAX-based search library with the option to let Google insert the results for you.

I use the AJAX option which dynamically displays search results on my current page (i.e., searching does not force me to navigate to a separate "search results" page).  You still have to write a little client-side code but that's easy.  In fact, I've posted basic info on one way to implement this in a DNN skin using nothing but NotePad.  I also show a working example of using the Google AJAX search to perform two simultaneous searches (web page + file search) with a single search box.  Also, I show one way to constrain the AJAX-based search to only include results from the websites you select.

See the example search and implementation info here:  http://googleAJAXsearch.com

   Add Google AJAX Search to DNN (Part 1):  http://eguanasolutions.com/Blog/tabid/54/EntryID/7/Default.aspx
   Add Google AJAX Search to DNN (Part 2):  http://eguanasolutions.com/Blog/tabid/54/EntryID/9/Default.aspx
   Add Google AJAX Search to DNN - Prevent ENTER from clearing results:  http://eguanasolutions.com/Blog/tabid/54/EntryID/14/Default.aspx
 

Good luck!
-mamlin
 


esmamlin atxgeek.me
 
New Post
12/16/2008 9:25 PM
 

mamlin wrote

I also was motivated to find a way to display Google Search results within my own DNN pages instead of a separate page.  There are a couple of ways to do this: (1) use your own code to query Google search "behind-the-scenes" and then parse and display the results yourself in your page, or (2) simply use Google's new AJAX-based search library with the option to let Google insert the results for you.

I use the AJAX option which dynamically displays search results on my current page (i.e., searching does not force me to navigate to a separate "search results" page).  You still have to write a little client-side code but that's easy.  In fact, I've posted basic info on one way to implement this in a DNN skin using nothing but NotePad.  I also show a working example of using the Google AJAX search to perform two simultaneous searches (web page + file search) with a single search box.  Also, I show one way to constrain the AJAX-based search to only include results from the websites you select.

See the example search and implementation info here:  http://googleAJAXsearch.com

   Add Google AJAX Search to DNN (Part 1):  http://eguanasolutions.com/Blog/tabid/54/EntryID/7/Default.aspx
   Add Google AJAX Search to DNN (Part 2):  http://eguanasolutions.com/Blog/tabid/54/EntryID/9/Default.aspx
   Add Google AJAX Search to DNN - Prevent ENTER from clearing results:  http://eguanasolutions.com/Blog/tabid/54/EntryID/14/Default.aspx
 

Good luck!
-mamlin

Hi mamlin,

Thanks for your blog, really informative - I however do not want the results on the current/any page - I want AJAX search results only on the Search Page. So there is the DNN core search textbox in the skin that redirects to my search page. On this search page I want to display the results for the querystring passed in, and have another textbox with the Google AJAX results so they can type into it.

Can you give me a pointer on where to start? From the threads I have read it seems that I need an iframe on my search results page.

I am also unsure how the Google Custom Search and the AJAX results are related - are they? For example, I have configured my GCS application (ie. filtered my site only and added refinements) and now I want to display these results on the search results page only.


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
12/17/2008 2:16 AM
 

I got this to work at Celebrity Couples Online, but it was a little chore.  I'm sure there is a more professional method, but here were the steps I took.

  1. Create a new page on your site that is hidden (I called mine GSearch), add a text module to the page, and paste the code that Google provides for search results into that text module using the source input option.  This will become your search results page.  Now you just need to modify your Skin files to pass over the details in the parameter that the Google code needs to see.
     
  2. In your /admin/skins directory, create a copy of these four files.
    1. Search.ascx -> GoogleSearch.ascx
    2. Search.ascx.resx -> GoogleSearch.ascx.resx
    3. Search.ascx.vb -> GoogleSearch.ascx.vb
    4. Search.xml -> GoogleSearch.xml
       
  3. In your /admin/skins/App_LocalResources directory, create a copy of Search.ascx.resx -> GoogleSearch.ascx.resx
     
  4. Open up GoogleSearch.ascx.vb
    1. Change Const MyFileName As String = "Search.ascx" to Const MyFileName As String = "GoogleSearch.ascx"
    2. Change the ExecuteSearch function to the below, inserting your own data where needed
        If Not String.IsNullOrEmpty(searchText) Then
             dim str as string
             str = "<YOUR NEW PAGE URL>?cx=<YOUR CSE ID>%3A72pzbzmchja&cof=FORID%3A9&ie=UTF-8&q=" & Server.UrlEncode(searchText)
        response.redirect(str)
        End If
       
  5. In GoogleSearch.ascx, change CodeFile="Search.ascx.vb" to CodeFile="GoogleSearch.ascx.vb" in top line.
     
  6. In your website skin files, change <%@ Register TagPrefix="dnn" TagName="SEARCH" Src="~/Admin/Skins/Search.ascx" %>  to <%@ Register TagPrefix="dnn" TagName="SEARCH" Src="~/Admin/Skins/GoogleSearch.ascx" %>

Hoping I didn't leave out a step, but it seems to work for me.  I'm not all that thrilled with Google CSE's indexing time however.

 
New Post
12/17/2008 7:26 PM
 

Thanks for that Terry - I may need that in the future.

I am trying the Google AJAX search first - I have done it slightly differently to how Mamlin suggests - so it is only on the Search Results page. You can also put the Jscript and code into an HTML module so you don't need to modify your skin. The core search control does not pass in the URL to my input textbox so this is the next step. I have left on the core search results for now so it is currently using the core and Google.

You can see it in action on the PokerDIY Search page (enter a search term in the search box on top right).


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...DNN and Google CSEDNN and Google CSE


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out