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 ...Integrating Google SearchIntegrating Google Search
Previous
 
Next
New Post
8/28/2009 3:00 AM
 

Hi,

I am looking to integrate the Google free search functionality into my DNN 5.1 site - including both search input and search results within my site.  Can anybody please advise as to best way to implement this e.g. via IFRAME or other.  Also, how do I remove the standard DNN search widget on the menu bar?

Many thanks,

Steve

www.lexido.com

 
New Post
8/28/2009 3:04 AM
 

Hi,

I feel Iframe module will help you to solve your problem.

To remove the existing search object. Pelase remove the [SEARCH] skin object from your skin.

All the best!


Sakthivel.S
 
New Post
8/28/2009 8:37 AM
 

You can also do this by using the basic html/text module. (I have implemented it using 2 of them, one for the search box and one for the results)

It works like this:

Add an html/text module to the page.  In the module settings under advanced settings add the following code to the header box. replace yoursite.com with whatever site you want to search.

   <!-- Replace with http://www.google.com/jsapi -->
    <script src="http://www.google.com/jsapi" type="text/javascript"></script>
    <script language="Javascript" type="text/javascript">//<![CDATA[
    google.load('search', '1');
   
    function OnLoad() {
   
      // create a search control
      var searchControl = new google.search.SearchControl();
   
      // web search, open, alternate root
      var options = new google.search.SearcherOptions();
      options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
      options.setRoot(document.getElementById("cse"));

   var siteSearch = new google.search.WebSearch();
siteSearch.setSiteRestriction("yoursite.com");
 
      searchControl.addSearcher(siteSearch, options);

      // tell the searcher to draw itself and tell it where to attach
      searchControl.draw(document.getElementById("search_control"));
    }
    google.setOnLoadCallback(OnLoad);
    //]]>
    </script>

Now add the following to the content source area of the module:

<!-- Google Custom Search Element -->
<div id="search_control" style="width: 100%;">&#160;</div>

 

Now add another instance of the html/text module to the page and add the following to the content source area of the module:

<!-- Google Custom Search Element -->
<div style="width: 100%;" id="cse">Loading</div>

 

You could also add the code to the skin file to get it on every page.  This was an example of how to place it on an existing page.

 

 

 

 

 

 

 
New Post
8/28/2009 4:00 PM
 

Steve_Q-
I've posted a short series on doing exactly this (replacing DNN search with Google Search) here:
 
  Add Google AJAX Search to your DNN skin - Part 1
  http://www.eguanasolutions.com/DNN_Blog/EntryID/7.aspx

  This URL points to the same series:
  http://googleAJAXsearch.com
 
The solution can be applied using a Text/HTML module (as is used for the working demo on the linked site) or by integrating into your DNN skin.  This is also using Google's newer AJAX search implementation which has a number of advantages over the old "submit-and-open-a-search-results-page" method.
 
Cheers!
-mamlin


esmamlin atxgeek.me
 
New Post
8/29/2009 11:36 AM
 

Mamlin,

Nice post.  I hadn't seen that before I created my solution.  Maybe I'll create a skin object that encapsulates all this and release it.

 

Robert

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Integrating Google SearchIntegrating Google Search


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