Ektron Reference |
Beginning with Ektron version 8.5, the capability of Search is enhanced with several new server controls. The server controls provide four major areas to organize your search.
Controls | Enables the searching of | For more information, see |
---|---|---|
Site Search server controls | Content, documents, file created or imported to the Workarea | Deploying Site Search Server Controls |
XMLSearchView server controls | XML content created with Smart Forms | XMLSearch Server Controls |
User Search Server Controls | CMS users, members, and membership groups | Deploying User Search Server Controls |
Product Search Server Controls | An eCommerce site for products in the eCommerce system | Deploying Product Search Server Controls |
NOTE: To apply paging to a search results page, use an EktronUI:Pager.
This section also contains these topics.
Templated server controls are more specialized than their predecessors, which typically used one control to retrieve and display results. To provide search functionality, use three templated controls.
An example of this relationship using site search controls is illustrated below.
Benefits of these controls include the ability to:
To replicate all of the previous search server controls' functionality, use a combination of templated controls. For example, use the Pager control to manage the paging of search results. Also, use the Advanced QueryText parameter to limit results to those in a selected folder, in a selected taxonomy category, etc.
Search server controls have no Ektron-specific properties. In contrast, the pre-8.5 Search server control properties let you configure language, Display XSLT, folder ID, etc.
Building Web Apps without Web Forms (http://msdn.microsoft.com/en-us/magazine/cc337884.aspx)
http://msdn.microsoft.com/en-us/library/ms228214.aspx
)You modify the behavior of templated controls by editing their markup. You no longer use Ektron server control properties nor an XSLT to edit the control's behavior.
You can edit a control's default markup, as well as the markup on any page that contains it.
See Also: Modifying the Text Displayed by Templated Server Controls
InputView and ResultsView controls have a corresponding .ascx template that contains their default markup. To change a control's default markup, modify its template.
To find a control's template file, open the folder site root\workarea\FrameworkUI\Templates\Search, and locate the .ascx file that matches the control's name. For example, siteroot\workarea\FrameworkUI\Templates\Search\SiteSearchResultsView.ascx.
NOTE: "Controller"controls only process data. Since they have no UI component, they do not have a template file.
The default .ascx file affects all instances of a control on your Web site. However, you may customize single instances of a control. To do so, see Modifying Markup for a Single Instance of a Control.
To customize a single instance of a templated search server control, follow these steps.
Within an </ItemTemplate> tag, use an eval statement (<%# Eval() >) to access Ektron's Search API object and expose its properties to the data binder. For example, <%# Eval (“QueryText”)%> displays the search term in the search results.
As an example, you can remove the summary from the search results by deleting this line.
<div class="summary"><%# Eval("Summary") %></div>
Use an <%# Eval()> statement to determine which field properties appear in search results. For example, <%# Eval("Summary")%> displays each content item's summary.
When you insert <%# Eval()> between a set of </ItemTemplate> tags, a model is passed to the statement. Each set of controls has a model that determines available fields and properties. For example, the SearchModel's Results property includes these fields:
The following topics list each model's fields and properties.
Follow these steps to discover a model's fields and properties using the Object Browser.
Other models are SearchModel (covers content and XML Smart Forms) and UserSearchModel.
To modify the text displayed by a templated control (for example, no results found), edit the corresponding .resx file in the site root\workarea\FrameworkUI\Templates\Search\app_loclaresources folder.
For example, to edit text supplied by the Site Search template, edit site root\workarea\FrameworkUI\Templates\Search\app_loclaresources\SiteSearchInputView.ascx.resx.
Ektron Version 8.5, Doc. Rev. 2.0 (Dec. 2011)
Visit the Ektron Dev Center at http://dev.ektron.com 1–866–4–EKTRON
Ektron Documentation, © 2011 Ektron, Inc.