The ContentList server control displays a list of content blocks on a Web page. In contrast to a List Summary, where content must be in a specified folder, the ContentList server control displays content from any Ektron folder. Depending on the setting you choose for DisplayXslt
, you can change information displayed for each content block.
When added to a template and visited, a ContentList Summary looks similar to the following.
DefaultContentID
property. See Also: Using Metadata to Display an Associated Content ListWhen using this option, an administrator typically sets up the Workarea portion of the process. Then, a developer adds the server control to a Web form and assigns the content block ID and the metadata name to the appropriate properties. Because the content list is assigned to a content’s metadata, you can pass the content ID dynamically in a Web form and display a list for each content block you defined.
ContentIds
property. See Also: Using the ContentID Property to Display a Content ListUsing the ContentIds
process, a developer adds the ContentList server control to Web form. Then, the developer defines a list of content IDs in the ContentIds
property. If the server control or the list in the ContentIds
property is deleted, it is not available and will have to be created again.
The following are Ektron-specific server control properties. You can find information about native .NET properties such as font, height, width and border style in Visual Studio® help.
Indicates if you are logged into the CMS Explorer and can use it to browse to content, collections, and so on. See Also: Browsing Your Ektron Site Using CMS Explorer.
The number of seconds that the server control’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.
A comma delimited list of content block IDs. See Also: Using the ContentID Property to Display a Content List
Set content ID value. When set, content IDs are generated from the MetaTag value for this content.
Determines how information on the page appears.
WARNING! If you specify an external file, do not store this file in the Workarea folder. If you store this file in the Workarea folder, the file will be lost when you upgrade.
If you enter a valid EkML file at the MarkupLanguage property, the Displayxslt property value is ignored.
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.
Uses the QueryString parameter to read a content ID dynamically.
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.
WARNING! This property only provides reliable data when the Business Analytics Feature is on. Business Analytics.
Set to True if you want to retrieve and display content (html body) for all content blocks in the list summary. For example, to display content inside a Web server control such as a GridView.
Hides or displays the output of the control in design time and run time.
Choose whether to display icons next to the content list’s links.
WARNING! 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 the MarkupLanguage
property, this property acts as True.
Set a language for viewing content; shows results in design-time (in Visual Studio) and at run-time (in a browser).
Determines the type of window that appears when you click a link in the server control.
Identify the template markup file that controls the display of the server control. For example, mymarkup.ekml
. If the EkML file is located in the same folder as the Web form containing the server control, just enter its name. Otherwise, the path to the file can be relative or absolute. See also: Controlling Output with Ektron Markup Language
See Also: contentlist.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, the IncludeIcons
property acts as True.
Specify a Metadata definition whose type is Content Selector. When you do, the associated list of content items will appear where you place the server control.
WARNING! You cannot insert other metadata types.
This works with the DefaultContentID
property. For more information about using metadata to assign a list of related content to a content item, see Creating and Deploying a Related Content Definition.
Determines which direction to sort content determined by the OrderBy
property.
If sorting by date, descending puts the most recent first. When ascending
is selected and the OrderBy
property is set to OrderOfTheIds
, the order of the IDs are preserved. When set to descending, the order is reversed.
Sort the list by one of these values:
ContentIds
property.Set to True if you want to randomly display one content block link from the content list. The content changes each time a user views the page.
NOTE: If you use a custom XSLT or EkML file, the type of content displayed can be manipulated. For example, if you use an EkML file that has the [$Html] variable in it, the actual content appears instead of a link. See Also: Controlling Output with Ektron Markup Language and [$Html]
This property is set to false
because Ajax uses <div>
tags to rewrite the region around the tag. You cannot change the value to true
.
Lets a developer specify a server control’s tag.
You can use the ContentList server control to display a list of content associated with a given content item. First, you define a content list in the metadata of a content block. Then, assign the ID of the content block to the ContentID
property and specify a Metadata definition in the MetaTag
property. The ContentList server control pulls information defined in the metadata of the content to display the list of content.
The following steps show how to use the DefaultContentID
and MetaTag
properties to create a content list.
MetaTag
property for the server control.DefaultContentID
property to the content block’s ID.MetaTag
property.ContentIds
property.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:
ContentID
property.TextMode
property to MultiLine.NOTE: You should set the text box width to at least 400 px.
Textbox1.Text = ContentList1.XmlDoc.InnerXml
For an additional example, see the ContentList XML page on the CMS400Developer samples page. It is located at:
In a browser:
http://siteroot/CMS400Developer/Developer/ContentList/ContentListXML.aspx
In the source code:
siteroot/CMS400Developer/Developer/ContentList/ContentListXML.aspx and ContentListXML.aspx.vb