Try Now
More in this section

Forums / Developing with Sitefinity / How to add view.more/ read more link in Blogs

How to add view.more/ read more link in Blogs

6 posts, 0 answered
  1. Ajay
    Ajay avatar
    46 posts
    14 Nov 2013
    16 Jun 2014
    Link to this post

    Hi All,

    I'm using sitefinity blog. in Every post i'm having 15-20 lines of data.

    I need to show 3 or 4 lines in blog's post , if click on View more, need to redirect description page.(please find attached image )

    Please guide me, how to write custom widget for this blog.




  2. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    18 Feb 2004
    16 Jun 2014
    Link to this post

    Hi Ajay,

    You can easily add the following line to the template.

    <sf:DetailsViewHyperLink CssClass="more" runat="server">> read more</sf:DetailsViewHyperLink>

    You probably need to add this in the template Titles, dates and summaries for the Blogs.

    Kind regards,
    Daniel Plomp

  3. Ajay
    Ajay avatar
    46 posts
    14 Nov 2013
    23 Jun 2014 in reply to Daniel Plomp
    Link to this post

    Hi Daniel,

    Thanks for Reply , It's working Fine

    I'm having one more issues , please check here and help me how to solve this issue. 




  4. Ajay
    Ajay avatar
    46 posts
    14 Nov 2013
    09 Jul 2014 in reply to Ajay
    Link to this post

    Hi Daniel,

    Read more is working fine and  i'm using Titles, Dates and Summaries  Template,

    How to add Comments before Read more?

    I'm adding below line of code ,but no luck .

    <comments:CommentsCountControl runat="server" ID="commentsCounterControl" AllowComments='<%# Eval("AllowComments") %>' ThreadKey='<%# ControlUtilities.GetLocalizedKey(Eval("Id")) %>' ThreadType='<%# Container.DataItem.GetType().FullName %>' DisplayMode="ShortText"/>

    please let me know, if i wrote any wrong syntax.

  5. Vassil Vassilev
     Vassil Vassilev avatar
    308 posts
    21 Jan 2015
    09 Jul 2014
    Link to this post
    Hello Ajay,

    Make sure you have included the necessary namespaces. For your convenience I am attaching a template that should work:
    <%@ 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" %>
    <%@ Import Namespace="Telerik.Sitefinity.Modules.Comments" %>
    <sf:SitefinityLabel id="title" runat="server" WrapperTagName="div" HideIfNoText="true" HideIfNoTextMode="Server" />
    <telerik:RadListView ID="Repeater" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
            <ul class="sfpostsList sfpostListTitleDateSummary sflist">
                <asp:PlaceHolder ID="ItemsContainer" runat="server" />
            <li class="sfpostListItem sflistitem" data-sf-provider='<%# Eval("Provider.Name")%>'  data-sf-id='<%# Eval("Id")%>' data-sf-type="Telerik.Sitefinity.Blogs.Model.BlogPost">
                <h2 class="sfpostTitle sftitle">
                    <sf:DetailsViewHyperLink TextDataField="Title" ToolTipDataField="Description" data-sf-field="Title" data-sf-ftype="ShortText" runat="server" />
                <div class="sfpostAuthorAndDate sfmetainfo">
                    <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}" />
                <sf:FieldListView ID="PostContent" runat="server" Text="{0}" Properties="Summary" WrapperTagName="div" WrapperTagCssClass="sfpostSummary sfsummary" EditableFieldType="ShortText" />
                <asp:PlaceHolder ID="socialOptionsContainer" runat="server">
                <comments:CommentsWidget runat="server"
                    ThreadKey='<%# ControlUtilities.GetLocalizedKey(Eval("Id"), null, CommentsBehaviorUtilities.GetLocalizedKeySuffix(Container.DataItem.GetType().FullName)) %>'
                    AllowComments='<%# Eval("AllowComments") %>' ThreadTitle='<%# Eval("Title") %>' ThreadType='<%# Container.DataItem.GetType().FullName %>'
                    GroupKey='<%# ControlUtilities.GetUniqueProviderKey("Telerik.Sitefinity.Modules.Blogs.BlogsManager", Eval("Provider.Name").ToString()) %>'
                    DataSource='<%# Eval("Provider.Name")%>' />
              <sf:DetailsViewHyperLink ID="FullStory" Text="<%$ Resources:BlogResources, FullStory %>" runat="server" CssClass="sfpostFullStory sffullstory" />
    <sf:Pager id="pager" runat="server"></sf:Pager>
    <asp:PlaceHolder ID="socialOptionsContainer" runat="server" />

    Hope this helps.

    Vassil Vassilev
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
  6. Ajay
    Ajay avatar
    46 posts
    14 Nov 2013
    10 Jul 2014
    Link to this post

    Hello Vassil Vassilev,

    Thanks for Quick Reply,

    working fine :) 

6 posts, 0 answered