MetadataList
IMPORTANT: Starting from release 8.6, the MetadataList server control was replaced by the FrameworkUI: <ektron:ContentView> templated server control. If you are already using the MetadataList server control, you can continue to do so, but Ektron recommends using current versions of functionality.
The MetadataList server control creates lists based on Keyword Names and Keyword Values contained within content metadata. The list can display the information as a list of hyperlinks. You can choose, based on properties you set, to display the summarya short description that supplements a content item's title on a Web page. Content authors compose a summary when creating or editing content. Server controls and widgets can display a content title and summary to attract readers to the full story. Summaries can include images and text formatting. and how to order the display. See also: Working with Metadata.
NOTE: On a PageBuilder page, you can insert a metadata list using the MetaDataList widget. See also: Creating and Using Widgets.
Inserting the MetadataList server control onto a page
Prerequisite
You must have installed the server controls. See Installing server controls into Visual Studio Toolbox.
- In Visual Studio, choose View > Toolbox.
- Click the Ektron server control tab to display the server controls.
- Drag the MetadataList server control and drop it into the desired location on the page.
NOTE: You also can place the cursor on the page where you want the server control, then double click the server control that you want.
<CMS:MetadataList ID="MetadataList1" runat="server" />
- Click on
MetadataList
in the code to display and modify the control’s properties using the Properties window of Visual Studio. The page is updated as you modify the property values.
MetadataList properties
The following are Ektron-specific server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified. properties. For information about native .NET properties such as font, height, width and border style, use Visual Studio® help.
- CacheInterval (Double)
The number of seconds that a server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified.’s data is cached. The default is 0 (zero). For example, if you want to cache the data for 5 minutes, set to 300. See also: Caching with server controls.
IMPORTANT: If the
EnablePaging
property is set to True, theCacheInterval
property is disabled. - ContentType (Ektron.Cms.Controls.CmsWebService.CMSContentType)
Select a type of content for this control. Choices are:
- All Types
- Content
- Forms
- Archive_Content
- Archive_Forms
- Assets
- Archive_Assets
- LibraryItem
- Multimedia
- Archive_Media
- NonLibraryContent
- DiscussionTopic
- DisplayXslt (String)
Determines how the information on the page appears
- None. Databind only
- ecmNavigation. Lists the title of every content block in the folder.
- ecmTeaser. Lists the title of every content block in the folder plus the content summarya short description that supplements a content item's title on a Web page. Content authors compose a summary when creating or editing content. Server controls and widgets can display a content title and summary to attract readers to the full story. Summaries can include images and text formatting..
- Path to Custom Xslt. If desired, enter a relative or absolute path to an Xslt that determines the display of the page.
WARNING! Files stored in the
siteroot\Workarea
folder are overwritten (or deleted) when you upgrade Ektron. To avoid problems, copy the default file to a folder outside thesiteroot\workarea
folder then edit it. If there is no default file, create the file outside thesiteroot\workarea
folder. Next, in this property, enter the path to that file relative to the site root folder.WARNING!
If you enter a valid EkML file at the MarkupLanguage property, the Displayxslt property value is ignored.
- DoInitFill (Boolean)
By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, Fill is automatically called during the Page Render event. You might do this if you need to set or change a property on the control in code-behind and have it render with your changes shown.
- EnablePaging (Boolean)
This property, in conjunction with the MaxNumber property, lets site visitors view an unlimited number of items while controlling the amount of screen space. The MaxNumber property limits the number of items displayed. If you set this property to True, and the number of items exceeds MaxNumber, navigation aids appear below the last item, allowing the visitor to go to the next screen. See example below.
So, for example, if specified metadata is found in 9 items and the
MaxResults
property is set to 3, the screen displays only the first 3 items. When the site visitor clicks [Next], the visitor sees items 4, 5 and 6.NOTE: If the
EnablePaging
property is set to True, theCacheInterval
property is disabled. - ExactPhrase (Boolean)
Determines whether the KeyWordValue needs to match the metadata value exactly. For example, if “site” is the KeyWordValue, the title of a content block is “Welcome to the site” and ExactPhrase is set to True, you would not see the content block in the metadata list. This is because “site” does not equal “Welcome to the site”.
- True. Match exact phrase
- False. Doesn’t need to match exact phrase
- True. Match exact phrase
- FolderID
The folder ID from which content is retrieved. At the
Recursive
property, you determine if content in this folder’s subfolders is also retrieved. - GetAnalyticsData (Boolean)
Set this property to True if you want the following information for each content in the list. Returns Content View Count, Content Rating, Content Rating Average. Create your own XSLT styles to display this data.
IMPORTANT: This property provides reliable data only when the Business Analytics Feature is on. See Running Ektron Business Analytics.
- GetHtml (Boolean)
Set to True if you want to display the content (html body) for all content to appear on this metadata list. For example, you want to display content inside a Web server control such as a GridView.
- Hide (Boolean)
Hides or displays the output of the control in design time and run time.
- True. Hide the control output.
- False. Display the control output.
- IncludeIcons (Boolean)
Choose whether to display icons next to the metadata list’s links.
NOTE: This property only works when ecmSummary or ecmTeaser are used in the
DisplayXslt
property. When the[$ImageIcon]
variable is used in an EkML file and that file is assigned to theMarkupLanguage
property, this property acts as True. - KeyWordName (String)
KeyWordName represents a metadata definition, that is, the container for the KeyWordValues. Examples of a KeyWordName are Keywords and Title. If you are authenticated, you can click the ellipsis button and select from a list of existing metadata definitions. For information on creating metadata definitions, see Adding a Metadata Definition.
- KeyWordValue (String)
Enter the values associated with the KeyWordName. Only content whose metadata (defined at the
KeyWordName
property) matches this value appears on the metadata list. Examples of a KeyWordValue are “home; page; company.”NOTE: The character that separates multiple items is defined at the
KeyWordValueSeparator
property. At theKeyWordValueMatchAll
property, you determine if all metadata definition values must match or any one of them. - KeyWordValue MatchAll (Boolean)
This property is only used if you enter more than one keyword value. If you do, and only want content to appear on the metadata list if all values entered at the KeyWordValue field match their metadata values, enter True. If metadata can appear on the list as long as any value defined at the KeyWordValue field matches the selected metadata value for a content item, enter False.
Example:
KeyWordValue for Title (assigned for this server control): home; page; company. Metadata values for a content item’s Title metadata definition field: software; ektron; company.
- If
KeyWordValueMatchAll =true
, content does not appear on metadata list because some items do not match. - If
KeyWordValueMatchAll = false
, content item appears on metadata list because one item (company) matches.
- If
- KeyWordValueSeparator (String)
Enter the character used to separate the list of keyword values. An example is a semicolon(;).
- Language (Integer)
Set a language for viewing content; shows results in design-time (in Visual Studio) and at run-time (in a browser).
- LinkTarget (ItemLinkTargets)
Determines the type of window that appears when you click a link in the server control.
- _Self (default). Opens in same window.
- _Top. Opens in parent window.
- _Blank. Opens in new window.
- _Parent. Opens in the parent frame.
- MarkupLanguage (String)
Enter the template markup file (
.ekml
) that controls the display of this server control. To use the default .ekml file, leave this field blank.The default file follows this pattern:\siteroot\Workarea\template\this object\objectname.ekml
. For example,\siteroot\Workarea\template\collection\collection.ekml.
To customize the default .ekml file, copy it to a folder outside thesiteroot\workarea
folder and edit it. Next, in this property, enter the path to that file relative to the site root folder.See also: Ektron Markup LanguageSee also: metadatalist.ekml
NOTE: If you enter a valid EkML file at the MarkupLanguage property, the Displayxslt property value is ignored. If the EkML file contains the
[$ImageIcon]
variable, theIncludeIcons
property acts as True. - MaxNumber (Integer)
Enter the maximum number of items to appear in the initial display of this server control. To set no maximum, enter zero (0). To let site visitors view more than the maximum but limit the amount of space being occupied, enter the maximum number of results per page here. Then, set the
EnablePaging
property to true.If you do and more than the number of
MaxResults
are available, navigation aids appear below the last item to help the site visitor view additional items. See example below. - OrderBy (Ektron.Cms.Controls.CmsWebService.ContentOrderBy)
The order of the list to be returned.
- Title. The title of the content block
- ID. The content block ID
- Date Created. The date the content block was created
- Date Modified. The date the content block was last modified
- LastEditorLname. The last editor’s last name
- LastEditorFname. The last editor’s first name
- ContentRatingAverage. Business Analytics Content Rating
- ContentViewCount. Business Analytics Content Views
- Recursive (Boolean)
Whether to search sub-folders of the identified root folder. The starting folder is identified in the
FolderID
property. - SortOrder (String)
Choose the order direction of the list, Ascending or Descending.
- SuppressWrapperTags (Boolean)
This property is set to
false
because Ajax uses<div>
tags to rewrite the region around the tag. You cannot change the value totrue
. - WrapTag (String)
Lets a developer specify a server control’s tag.
- Span (default). Designate an inline portion of an HTML document as a span element.
- Div. Apply attributes to a block of code.
- Custom. Lets you use a custom tag.
Retrieving the XML structure of a MetadataList
Retrieving the XML structure of XML content allows for greater control over developing XSLs. The following is an example of how to retrieve the XML structure.
- Open a new Web form.
- Drag and drop a MetadataList server control onto it.
- Set the
KeyWordName
andKeyWordValue
properties. - Drag and drop a textbox on the Web form.
- Set the
TextMode
property to MultiLine.NOTE: Set the text box width to at least 400px.
- On the code-behind page, add the following line.
Textbox1.Text = Metadata1.XmlDoc.InnerXml
- Build the project.
- View the Web form in a browser.
- The XML structure of the MetadataList appears in the textbox.