R2i DotNetNuke® Forum

R2i wants you to have the opportunity to ask questions, post reviews, help others or just rant and rave about DotNetNuke® or any of the R2i Modules and Skins. Our team spends hour upon hour, day after day, working on custom DotNetNuke® modules and services; please feel free to ask us anything.
 
Extending the DotNetNuke Search Features
Last Post 01 Jan 1900 05:00 AM by . 0 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Informative
contactdpUser is Offline
Basic Member
Basic Member
Posts:475

--
10 Aug 2007 03:02 PM  
Starting with DNN version 4.5.2, there is a new search feature that allows you to have options for global web as well as your site.

Several users have complained of this new feature causing issues with the skin template. While many people voiced concerns and frustrations over the new capability – it is obvious that the core team has the best intentions in mind, and have greatly broadened the capability with this new set of features.

According to Shaun Walker, these options were added so that it is simple for users to include the standard "search the web" or "search my site" functionality while being completely extensible.

To enable or disable the options in the skin object, you must simply set the public attributes in your skin ( like any other skin object ):

<dnn:SEARCH runat="server" id="dnnSEARCH" showWeb="False" showSite="False" />

0r for HTML skins, in the skin XML file:

<Object>
<Token>[SEARCH]</Token>
<Settings>
<Setting>
<Name>showWeb</Name>
<Value>False</Value>
</Setting>
<Setting>
<Name>ShowSite</Name>
<Value>False</Value>
</Setting>
</Settings>
</Object>

Note that you can set one option to True and the other to False for even more customization.

In addition there is another attribute:

UseWebForSite="True"

This option can be used if you want to leverage a search engine like Google for your internal site search - rather than using the native DNN search engine. In this case the results for a Site search will return publicly accessible results for only your website from a remote search engine.

This feature even enables participation in revenue sharing from Google ads.

In order to do so you need to change the default client id to your own. You can do that by changing the language resource file at admin/skins/App_LocalResources/Search.ascx.resx

Look for the Url key that looks like this:

<data name="URL.Text">
<value>http://www.google.com/custom?hl=en&client=pub-9770992166002654&sitesearch=[DOMAIN]&q=[TEXT]</value>
</data>

In this case the Web search is done using Google and passing an affiliate ClientID, optional SiteSearch domain name, and the search query. Any or all of the values in this resouce string can be modified to suit your needs. Note that by default, the DotNetNuke project ClientID is included in the search query, as it is an inobtrusive way for DNN to generate a bit advertising revenue to help offset the costs of provifing community programs and managing the open source project.

You can even support other search engines, for example for MSN you could specify:

<data name="URL.Text"> <value>http://search.msn.com/results.aspx?q=[TEXT]</value>
</data>
Durga Prasad(DP) | Senior Web Engineer<br>R2integrated
You are not authorized to post a reply.

Active Forums 4.1
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share