Some days ago I made a great discovery… the Google Custom Search Engine http://www.google.com/cse/:
You can create a custom search engine dedicated to your web site, it’s free and it doesn’t show advertisings (if you don’t need them).
Configure your web site address:
Try the search :
Get the JavaScript code:
You can also customize how the search works, add autocomplete, synonyms, add specific pages from other web sites…
If you want to add it to DNN you can follow this simple steps:
- You need to add one custom page to DNN , this will be the page that will show the search results and you need to connect the DNN search field to the google custom search page.
- Change the DNN search field, find the \DotNetNuke5\admin\Skins\Search.ascx.vb file and add this lines of code, a simple redirect to the new search page:
Protected Sub ExecuteSearch(ByVal searchText As String, ByVal searchType As String)
If Not String.IsNullOrEmpty(searchText) Then
Response.Redirect("/tabid/<YOUR SEARCH PAGE ID>/default.aspx" & "?q=" & Server.UrlEncode(searchText))
return
- The google search engine automatically uses the query string parameter as search word, you need to use the “q” parameter.
- That’s all!
No comments:
Post a Comment