ContentList
IMPORTANT: Starting from release 8.6, the ContentList 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. was replaced by the FrameworkUI: <ektron:ContentView> templated server control. If you are already using the ContentList server control, you can continue to do so, but Ektron recommends using current versions of functionality.
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.
- Define a content list in a content block's metadata. Then, assign that content block’s ID in the
DefaultContentID
property.When 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.
- Assign a comma-delimited list of content blocks to the
ContentIds
property. See also:Using the
ContentIds
process, a developer adds the ContentList server control to Web form. Then, the developer defines a list of content IDs in theContentIds
property. If the server control or the list in theContentIds
property is deleted, it is not available and will have to be created again.
Inserting the ContentList 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 ContentList 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:ContentList ID="ContentList1" runat="server" />
- Click on
ContentList
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.
ContentList 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.
- ContentIds (String)
A comma delimited list of content block IDs.
- DefaultContentID (Long)
Set content ID value. When set, content IDs are generated from the MetaTag value for this content.
- DisplayXslt (String)
Determines how information appears on the page.
- None. Databind only
- ecmNavigation. Lists the title of each content block.
- ecmTeaser. Lists the title of each content block 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..
- ecmUnOrderedList. Sorts the list in no particular order. Shows the title and content summary.
- 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.
- None. Databind only
- 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.
- DynamicParameter (String)
Uses the QueryString parameter to read a content ID dynamically.
- None - Use Default. Use the default content ID list.
- ID. Reads a content block’s ID dynamically.
- ekfrm. Reads a form block’s ID dynamically.
- None - Use Default. Use the default content ID list.
- 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)
- True. 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.
- False. Do not get and display HTML.
- True. 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.
- 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 content list’s links.
IMPORTANT: This property works only 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. - 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: 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, theIncludeIcons
property acts as True. - MetaTag (String)
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.
NOTE: 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. - OrderBy (Ektron.Cms.Controls.CmsWebService.ContentListOrderBy)
Sort the list by one of these values:
- Title. Alphabetically, by content title
- DateModified. The last date content was modified
- DateCreated. The date content was created
- LastEditorFname. The last editor’s first name
- LastEditorLname. The last editor’s last name
- OrderOfTheIds. Preserves content ID order based on
ContentIds
property - ContentRatingAverage. Business Analytics Content Rating
- ContentViewCount. Business Analytics Content Views
- Title. Alphabetically, by content title
- OrderByDirection (Ektron.Cms.Controls.CmsWebService.ContentListOrderByDirection)
Determines which direction to sort content determined by the
OrderBy
property.- ascending. Items are arranged A, B, C or 1,2,3.
- descending. Items are arranged. Z,Y,X or 3,2,1.
If sorting by date, descending puts the most recent first. When
ascending
is selected and theOrderBy
property is set toOrderOfTheIds
, the order of the IDs are preserved. When set to descending, the order is reversed. - ascending. Items are arranged A, B, C or 1,2,3.
- Random (Boolean)
- True. Randomly display one content block link from the content list. The content changes each time a user views the page.
- False. Display the content list normally.
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: Ektron Markup Language and [$Html]
- True. Randomly display one content block link from the content list. The content changes each time a user views the page.
- 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.