Skin Search Control

DotNetNuke has a built-in search control for use within the design of a skin.

When designing a DotNetNuke skin as an HTML file add the token [search] at the point within the design where the search is to be shown. Importing the skin will replace the token with the required code in the resulting .ascx file. The parameters can be defined in the associated xml file.

If designing the skin directly using the .ascx file then at the top of the file add:

<%@ Register TagPrefix="dnn" Tagname="Search" Src="~/Admin/Skins/search.ascx" %>

and at the location where the search is to appear add:

<search id="dnnSearch" runat="server" ></search>

Parameters

The DotNetNuke search control supports searching of both the website and the wider Internet.

The search control supports optional parameters to show radio buttons, or a drop down list for search the web or search the site. By default a radio button is visible for both of site and web to direct the search results. These are controlled by the parameters showsite and showweb, which have the values True or False.

  • showsite=”False”
  • showweb=”False”

Updating the code within the skin to incorporate these two item, turning off both of the radio buttons gives:

<search id="dnnSearch" runat="server" showsite="False" showweb="False" ></search>

The parameters available for inclusion are:

  • UseDropDownList
  • SiteIconURL
  • SiteText
  • SiteToolTip
  • SiteURL
  • Submit
  • WebIconURL
  • WebText
  • WebToolTip
  • WebURL

UseDropDownList

A dropdownlist is shown, indicated with the DotNetNuke logo and a down arrow. Clicking on the arrow shows selections for site and web. This visibility of this is controlled using True or False. The default is False – hidden.

SiteIconURL

This replaces the DotNetNuke logo, used in the drop down list with the one specified.

SiteText

The text entered for this parameter replaces the word site when showing either the radio button or dropdownlist for search source selection.

SiteToolTip

This provides a tooltip for the mouseover of the site radio button.

SiteURL

On testing in DNN7 this parameter did not appear to be referenced.

Submit

The text to use in place of the default “Submit”

WebIconURL

The web equivalent to the siteiconurl. It enables the default Google icon to be changed.

WebText

Replacement words for the web option used in the radio button and dropdownlist.

WebToolTip

Tooltip text for the mouseover of the web text used in the radio button.

WebURL

The URL to use for the search, opens in a new popup window. This ought to be defined as a fully defined URL including http://. Omitting this will create a relative reference on the existing website. The default external website used for searches is google.com. Adding the token [text] will pass the search query to the referenced website page.

Presentation

ui styling