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

Forums / General Discussions / News widget template

News widget template

3 posts, 0 answered
  1. Vyacheslav
    Vyacheslav avatar
    11 posts
    Registered:
    18 Nov 2010
    17 Sep 2011
    Link to this post
    Hi.

    I am trying to add custom template for the latest news displaying. I've copied the standart template into a new one and changed it:

    <%@ 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" %>
    <h2>Latest Articles</h2>
     
    <telerik:RadListView ID="NewsList" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
        <LayoutTemplate>      
            <ul class="sfnewsList sfnewsListTitleDateSummary">
                <asp:PlaceHolder ID="ItemsContainer" runat="server" />
            </ul>
        </LayoutTemplate>
        <ItemTemplate>
            <li class="sfnewsListItem">
    <h3>
    <sitefinity:TextField runat="server"  Value='<%# Eval("Title")%>'  />           
    </h3>
                <sf:FieldListView ID="summary" runat="server" Text="{0}" Properties="Summary" WrapperTagName="p"   />
    <p>
                <sf:DetailsViewHyperLink ID="FullStory" Text="Read more" runat="server" CssClass="sfnewsFullStory" />
    </p>        
            </li>
        </ItemTemplate>
    </telerik:RadListView>
    <sf:Pager id="pager" runat="server"></sf:Pager>

    All latest news are displayed correctly, but I've found a strange code genereated beneath every title :
    <div id="ctl00_cphLatestArticles_C007_ctl00_ctl00_ctl00_NewsList_ctrl0_ctl00_ctl00_ConditionalTemplates" style="display:none;">
            <div id="ClientTemplatePanel_">
         
                <span id="titleLabel_write_" class="sfTxtLbl"></span>
                <a onclick="return false;" id="expandButton_write_" class="sfOptionalExpander"></a>
                <div id="expandableTarget_write_" class="sfFieldWrp">
             
                    <input name="textBox_write_" type="text" id="textBox_write_" class="sfTxt">
                    <div id="descriptionLabel_write_" class="sfDescription">
                 
            </div>
                    <div id="exampleLabel_write_" class="sfExample">
                 
            </div>
                 
        </div>
             
    </div>
        </div>

    Is it possible to remove it? I want to have as less html validation erorrs as possible but html elements with same id's causes a lot of validation errors.

    P.S  A am using Sitefinity 4.1
  2. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    19 Sep 2011
    Link to this post
    Hello Vyacheslav,

    Instead of

    <sitefinity:TextField runat="server"  Value='<%# Eval("Title")%>' />

    you could use this:

    <asp:Label runat="server" Text='<%# Eval("Title")%>' />

    All the best,
    Lubomir Velkov
    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
  3. Vyacheslav
    Vyacheslav avatar
    11 posts
    Registered:
    18 Nov 2010
    19 Sep 2011
    Link to this post
    Hello, Lubomir

    Thank you for your answer, all works fine now.

3 posts, 0 answered