Control for rendering news list with specialized template for top level news.
Namespace:
EPiServer.Web.WebControlsAssembly: EPiServer.Web.WebControls (in EPiServer.Web.WebControls.dll) Version: 6.1.379.0
Syntax
| C# |
|---|
[DefaultPropertyAttribute("Count")] public class NewsList : PageListData |
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.
Copy
<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>
Inheritance Hierarchy
System..::.Object
System.Web.UI..::.Control
EPiServer.Web.WebControls..::.PageControlBase
EPiServer.Web.WebControls..::.PageListData
EPiServer.Web.WebControls..::.NewsList
System.Web.UI..::.Control
EPiServer.Web.WebControls..::.PageControlBase
EPiServer.Web.WebControls..::.PageListData
EPiServer.Web.WebControls..::.NewsList