November Happy Hour will be moved to Thursday December 5th.

Class NewsList

Control for rendering news list with specialized template for top level news.

Inheritance
System.Object
NewsList
Implements
System.ComponentModel.INotifyPropertyChanged
System.Collections.IEnumerable
System.Web.UI.INamingContainer
Namespace: EPiServer.Web.WebControls
Assembly: EPiServer.Web.WebControls.dll
Version: 11.20.7
Syntax
public class NewsList : PageListData, INotifyPropertyChanged, IPageControl, IEnumerable, IPageSource, INamingContainer
Remarks

NewsList has special templates for the first four news and a default NewsTemplate, if you specify NewsTemplate it will be used as fallback for the first four templates that have not been set.

If you have defined all templates except NewsTemplate, you will never see more than four news (you only have definitions for the first four news). If you have defined four templates, but only have two news to display, then only two news will be displayed.

NewsList sets SortBy to "PageStartPublish" and SortDirection to Descending by default.

Examples
  Example usage of NewsList with special design for the first news.
    <episerver:NewsList PageLink="<%#EPiServer.Core.PageReference.StartPage%>" runat="server" ID="Newslist1">
<FirstNewsTemplate>
<episerver:property ID="Property1" CssClass="TopNews" PropertyName="PageLink" runat="server"/>
<episerver:property ID="Property2" PropertyName="MainBody" runat="server"/>
<br/>
</FirstNewsTemplate>
<NewsTemplate>
<episerver:property ID="Property3" CssClass="NewsLink" PropertyName="PageLink" runat="server"/>
<br/>
</NewsTemplate>
</episerver:NewsList>

Constructors

NewsList()

Declaration
public NewsList()

Properties

FirstNewsTemplate

The template for the first item

Declaration
public ITemplate FirstNewsTemplate { get; set; }
Property Value
Type Description
System.Web.UI.ITemplate

FooterTemplate

Default template for pages

Declaration
public ITemplate FooterTemplate { get; set; }
Property Value
Type Description
System.Web.UI.ITemplate

FourthNewsTemplate

The template for the fourth item

Declaration
public ITemplate FourthNewsTemplate { get; set; }
Property Value
Type Description
System.Web.UI.ITemplate

HeaderTemplate

Default template for pages

Declaration
public ITemplate HeaderTemplate { get; set; }
Property Value
Type Description
System.Web.UI.ITemplate

NewsTemplate

Default template for pages

Declaration
public ITemplate NewsTemplate { get; set; }
Property Value
Type Description
System.Web.UI.ITemplate

SecondNewsTemplate

The template for the second item

Declaration
public ITemplate SecondNewsTemplate { get; set; }
Property Value
Type Description
System.Web.UI.ITemplate

ThirdNewsTemplate

The template for the third item

Declaration
public ITemplate ThirdNewsTemplate { get; set; }
Property Value
Type Description
System.Web.UI.ITemplate

Methods

CreateChildControls()

Declaration
protected override void CreateChildControls()

Implements

System.ComponentModel.INotifyPropertyChanged
System.Collections.IEnumerable
System.Web.UI.INamingContainer

Extension Methods