Trying to implement Google Custom Search in DNN 6.2.9
Last Post 07/28/2014 1:34 PM by Joseph Craig. 5 Replies.
Author Messages Resolved
Heather Hugh-Jones (formerly GM)
Nuke Active Member
Nuke Active Member
Posts:31


--
07/09/2014 3:50 PM
    Looking for someone who has some experience in implementing Google Custom Search in DNN 6.2.9. I have Google Custom Search working on the Search Results page, but I need assistance in getting the search input box that I have on every page to use the Google Custom Search and not use the Core DNN Search. Is there a way to redirect the Core DNN Search to the Google Custom Search?

    I attached a screenshot of what I am trying to do.

    Any assistance is greatly appreciated.

    Gayle
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    07/09/2014 4:00 PM
    I did a search for "DNN Google Custom Search" and that turns up a number of links.

    First: http://devcoma.blogspot.com/2013/01...your.html. Note that this requires a modification of the \admin\Skins\Search.ascx.vb file (The article was written for DNN 5, but you'll probably find that the code for later versions of DNN is quite similar).

    You will also find several modules that do the integration for you. One advantage to going the module route is that you won't have to redo the modification to the DNN core whenever you upgrade. You may also find some nicer features, ease in styling, etc. Though I don't have experience with any of these modules, there seem to be both demos and trial versions. Take advantage of them to see if they do what you need.

    Joe Craig, Patapsco Research Group
    Complete DNN Support
    Heather Hugh-Jones (formerly GM)
    Nuke Active Member
    Nuke Active Member
    Posts:31


    --
    07/10/2014 11:35 AM
    Hi Joe,

    Thanks for responding.

    Yes, I reviewed the link you sent last week and I have not found the code for DNN 6. Anyone out there have this code? I thought I found the resolution here but then realized the article was for DNN 5. DNN 5 and 6 are a bit different in their code structure..

    I am aware of some modules that will add Google Search functionality, this may be the only way to implement what I need.

    Thanks again for the response.

    Joseph Craig
    DNN MVP
    Posts:11667


    --
    07/10/2014 2:44 PM
    Ah, I had neglected to remember that DNN 5 is written in VB and DNN 6 and 7 are written in c#. So, you want to be looking at search.ascx.cs.

    I don't have a handy copy of DNN6, but DNN7 does have a method ExecuteSearch in that file. You could edit that with an appropriate single-line replacement of what is there with this:

       
       
        protected void ExecuteSearch(string searchText, string searchType) {
            if (!string.IsNullOrEmpty(searchText)) {
                Response.Redirect(("/tabid/<YOUR SEARCH PAGE ID>/default.aspx" + ("?q=" + Server.UrlEncode(searchText))));
                return;
            }
        }
    
    




    I'd still recommend going with a module, though.

    Joe Craig, Patapsco Research Group
    Complete DNN Support
    Heather Hugh-Jones (formerly GM)
    Nuke Active Member
    Nuke Active Member
    Posts:31


    --
    07/28/2014 1:05 PM
    I found a module called TanLD Custom Google Search Module that has exactly what I am looking for. It only costs $15 in addition to purchasing Google Custom Search subscription.
    Joseph Craig
    DNN MVP
    Posts:11667


    --
    07/28/2014 1:34 PM
    Great!

    Joe Craig, Patapsco Research Group
    Complete DNN Support


    ---