1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Newsletter block template editing..need help

Newsletter block template editing..need help

4 posts, 0 answered
  1. can
    can avatar
    36 posts
    Registered:
    07 Jun 2011
    21 Jul 2011
    Link to this post
    Hi everyone

    I am working on a page which contains some news and blog posts contents.I want to modify newsletter block as same as i see in this video at 22:16.

    http://www.sitefinity.com/devnet/video-tutorials/development/givecamp---designing-your-sitefinity-project.aspx

    i used this code :

    <%@ Control Language ="C#" %>
    <%@ Register TagPrefix="sf" Namespace= "Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace= "Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="telerik" Namespace= "Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="cc1" Namespace= "SitefinityWebApp.Tools" Assembly="SitefinityWebApp" %>

    <telerik:RadListView ID="eventsList" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">

         <LayoutTemplate>
             <ul class="sfeventsList sfeventsListTitleCityDateContent">
                 <asp:PlaceHolder ID="ItemsContainer" runat="server" />
             </ul>

         </LayoutTemplate>
         <ItemTemplate>
             <li class="sfeventListItem">
                 <div class="sfeventDateSummary">
                  <div class="sfeventDay"><%#Eval("EventStart","{0:ddd}")%></div>
                  <div class="sfeventDate"><%#Eval("EventStart","{0:dd}")%></div>
                  <div class="sfeventMonth"><%#Eval("EventStart","{0:MMM")%></div>
               </div>

               <h3 class ="sfeventTitle">
                    <sf:DetailsViewHyperLink ID="DetailsViewHyperLink1" TextDataField="Title" ToolTipDataField ="Description" runat="server"/>
               </h3>             
               <div class ="sfeventMetaInfo">
                   <sf:FieldListView ID ="where" runat = "server" Text="{0} |"Properties ="City" />
                   <sf:FieldListView ID ="EventsDates" runat="server" />
                </div>
                <div class ="sfeventContent">
                   <cc1:Truncate Text='<%# Eval("Content")%>'Length="200" runat="server" />
                   <sf:DetailsViewHyperLink ID ="DetailsViewHyperLink2" Text="Read more" runat="server" />
                </div>
            </li>
         </ItemTemplate>
    </telerik:RadListView>
                 


    I am getting "Error parsing the template" error...what should i do to fix this?

    Regards.
  2. can
    can avatar
    36 posts
    Registered:
    07 Jun 2011
    26 Jul 2011
    Link to this post
    I am still waiting for a reply...
  3. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    16 Aug 2017
    26 Jul 2011
    Link to this post
    Hi Can,

    Can you please make sure you have properly registered the Trunkate control? Please find below its default implementation, you should add a class Trunkate.cs in a folder Tools in your SitefinityWebApp.
    using System.Web.UI.WebControls;
     
    namespace SitefinityWebApp.Tools
    {
        public class Truncate : Literal
        {
     
            public int Length
            {
                get
                {
                    return _length;
                }
                set
                {
                    _length = value;
                }
            }
     
             
            protected override void CreateChildControls()
            {
                if (Text != null || Text.Length > Length) {
     
                    // Don't truncate in the midst of a word
                    int iNextSpace = Text.LastIndexOf(" ", Length);
                    Text = string.Format("{0}...", Text.Substring(0, (iNextSpace > 0) ? iNextSpace : Length).Trim());
                }
     
                base.CreateChildControls();
            }
     
            private int _length = 20;
     
        }
    }

    Greetings,
    Boyan Barnev
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  4. can
    can avatar
    36 posts
    Registered:
    07 Jun 2011
    27 Jul 2011
    Link to this post
    Thank you Boyan...problem solved.
4 posts, 0 answered