我修改了博客小部件的现有模板,仅显示我真正需要的内容。现在,我想添加一个包含下一个和上一个按钮的自定义分页,并且可以根据当前页面显示最多5个页面列表。
请注意以下内容:
<< 1 2 3 4 5>>
或
<< 7 8 9 10 11>>
以下是我的模板。
<%@ Control Language="C#" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Comments" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend" TagPrefix="comments" %>
<%@ Import Namespace="Telerik.Sitefinity" %>
<%@ Import Namespace="Telerik.Sitefinity.Web.UI" %>
<telerik:RadListView ID="Repeater" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="true" EnableEmbeddedBaseStylesheet="true">
<LayoutTemplate>
<asp:PlaceHolder ID="ItemsContainer" runat="server" />
</LayoutTemplate>
<ItemTemplate>
<div data-sf-provider='<%# Eval("Provider.Name")%>' data-sf-id='<%# Eval("Id")%>' data-sf-type="Telerik.Sitefinity.Blogs.Model.BlogPost">
<h2>
<sf:DetailsViewHyperLink TextDataField="Title" ToolTipDataField="Description" data-sf-field="Title" data-sf-ftype="ShortText" runat="server" />
</h2>
<p><small>
<asp:Literal ID="Literal2" Text="<%$ Resources:Labels, By %>" runat="server" />
<sf:PersonProfileView runat="server" />
<sf:FieldListView ID="PostDate" runat="server" Format=" | {PublicationDate.ToLocal():MMM dd, yyyy}" />
<!--<comments:CommentsCountControl runat="server" ID="commentsCounterControl" AllowComments='<%# Eval("AllowComments") %>' ThreadKey='<%# ControlUtilities.GetLocalizedKey(Eval("Id")) %>' ThreadType='<%# Container.DataItem.GetType().FullName %>' DisplayMode="ShortText"/>-->
</small>
</p>
<br />
<sf:FieldListView ID="PostContent" runat="server" Text="{0}" Properties="Content" WrapperTagName="div" WrapperTagCssClass="sfpostContent" EditableFieldType="LongText"/>
<br/>
<%--
<div class="sfpostCategoriesAndTagsWrp">
<sitefinity:HierarchicalTaxonField ID="HierarchicalFieldControl" DisplayMode="Read" BindOnServer="true" runat="server" TaxonomyId="E5CD6D69-1543-427b-AD62-688A99F5E7D4" WebServiceUrl="~/Sitefinity/Services/Taxonomies/HierarchicalTaxon.svc" Expanded="false" TaxonomyMetafieldName="Category" Title="Categories" ResourceClassId="TaxonomyResources" HideWhenNoTaxaFound="true" />
<sitefinity:FlatTaxonField ID="FlatFieldControl" DisplayMode="Read" BindOnServer="true" runat="server" TaxonomyId="CB0F3A19-A211-48a7-88EC-77495C0F5374" WebServiceUrl="~/Sitefinity/Services/Taxonomies/FlatTaxon.svc" Expanded="false" TaxonomyMetafieldName="Tags" Title="Tags" ResourceClassId="TaxonomyResources" HideWhenNoTaxaFound="true" CssClass="sfpostTagsWrp" />
</div>
--%>
</div>
</ItemTemplate>
</telerik:RadListView>
<ul class="pagination">
<sf:Pager ID="pager" runat="server">
</sf:Pager>
</ul>
答案 0 :(得分:0)
以下是一些描述如何覆盖内置Sitefinity寻呼机默认功能的链接:
http://blog.falafel.com/blogs/george-saadeh/2012/01/05/extending_sitefinity_pager_control
http://www.sitefinity.com/blogs/team-blog/2011/12/14/extending_the_default_pager_control
两者的底部都是下载源代码的链接。