Glossary Item Box

Modules: Modules

Installation: DataBase configuration

See Also CmsDeveloperGuide Send comments on this topic.

Search

This module allows site search and displaying search results list. Search is realized in the following modules content: Page, PageList, News, Events, MailForm, Catalog, SimpleShop, GuestBook.

For correct work of the search in is necessary to set up full text search in the CMS database.

TextBox for search text input

To create a text field to input the text you want to find on the site it is used a SearchBox control. This control is usually placed on the site master page. But you can place it everywhere on the site.


Example of using SearchBox control:

<%@ Register TagPrefix="cmssearch" Namespace="CMSLib.Search" Assembly="CMSLib" %>

<cmssearch:searchBox id="searchBox1" runat="server" SearchControlName="Search1" Text="Search..."
    CssClass="small" ButtonText="Search" ButtonCssClass="button" />

 

You can set any text in a Text property and it will appear in the TextBox before clicking on it.
 

Search results output

A template file for output of the site search results locates in modules/search.ascx. It usually contains a SearchBox tag (for search text input) and a Search tag (for results output).

 

In the Search tag you can use the following tags:

 

In the SarchResultTemplate tag of the Search tag you can use the following parameters:  

Template's part Description
<%# Container.Number %> Record's number
<%# Container.ModuleType %> Module type
<%# Container.URL %> URL to searched page
<%# Container.Title %> Content's title
<%# Container.Snippet %> Snippet
 

In the SummaryTemplate tag of the Search tag you can use the following parameters:

Template's part Description
<%# Container.StartIndex %> Start showed record index
<%# Container.EndIndex %> End showed record index
<%# Container.Total %> Total number of records
 
 
A template file for the site search results output can look as follows:

<%@ Control Language="c#" Inherits="CMSLib.Search.SearchResultPage" %>
<%@ Register TagPrefix="cmssearch" Namespace="CMSLib.Search" Assembly="CMSLib" %>

<cmssearch:searchBox id="searchBox1" runat="server" SearchControlName="Search1" Text="Search..."
    CssClass="small" ButtonText="Search" ButtonCssClass="button" />

<br />
<cmssearch:search id=Search1 runat="server">
<SummaryBar>Results: <B><%# Container.StartIndex %></B>-<B><%# Container.EndIndex %> </B> of >B><%# Container.TotalRows %></B></SummaryBar>
<TEMPLATE>
    <%# Container.Number %>.
    <A href="<%# Container.URL%>">
    <U><%# Container.Title %></U></A>
    <BR><%# Container.Snippet %>
    <%# Container.URL%><BR>
</TEMPLATE>
<Separator><HR></Separator>
<TextNotFound>Text not found</TextNotFound>_SummaryBar
</cmssearch:search>

Modules: Modules

Installation: DataBase configuration

 

 


© 2005-2007 Astron Digital Ltd. All Rights Reserved.