Googler search results page

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
9/23/2011 10:19:16 AM
Gravatar
Total Posts 87

Googler search results page

Hi

I could not find a way to make google custom search on search results page to catch query and do the search (in layout master i have textbox to enter search query and it works with native search fine , but shows empty page in results if i switch to google serach).

so trying to solve this isuue i had to make this addition in the googlecustomsearchcontrol

 

if (HttpContext.Current.Request.QueryString["q"] != null && HttpContext.Current.Request.QueryString["q"]!="")
                writer.Write("customSearchControl.execute('" + HttpContext.Current.Request.QueryString["q"] + "');");

may be i missed some option in settings, but if no i suggest to include some code like this in future releases. (of course my code probably needs some more validations and error checks :))

Rgerads,

Victor

9/25/2011 8:25:39 AM
Gravatar
Total Posts 18439

Re: Googler search results page

Hi Victor,

I just pushed a change to the source code repository like this:

if (!Page.IsPostBack)
            {
                if (HttpContext.Current.Request.QueryString["q"] != null && HttpContext.Current.Request.QueryString["q"].Length > 0)
                {
                    writer.Write("customSearchControl.execute('" + SecurityHelper.SanitizeHtml(HttpContext.Current.Request.QueryString["q"]) + "');");
                }
            }

but I have not tested it, can you test it and verify it still works?

Thanks,

Joe

9/26/2011 9:59:34 AM
Gravatar
Total Posts 87

Re: Googler search results page

Yes,

thank you it works, and i was afraid that i missed some html encoding for this so now with SanitizeHtml it will work more robust.

 

Regards,

Victor

You must sign in to post in the forums. This thread is closed to new posts.