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

Forums / Developing with Sitefinity / News ControlTemplates files found in External Templates Zip differ from files as installed (3.7 sp1)

News ControlTemplates files found in External Templates Zip differ from files as installed (3.7 sp1)

2 posts, 1 answered
  1. Clancy
    Clancy avatar
    3 posts
    Registered:
    13 Jun 2009
    09 Mar 2010
    Link to this post
    As I am getting into modifying control templates by getting from the External Templates zip, I notice that some News files already exist in the installed directories and they are different than the ones from the External Templates zip.  I am using Sitefinity 3.7 SP1 Community version.  It was installed using "Sitefinity_3_7_2022_community.exe" file and the external templates file I have is named "Sitefinity_3_7_2022_community_ExternalTemplates.zip".

    In the Sitefinity\ControlTemplates\News directory, there already is a ListPageMaster.ascx and it is different than the corresponding file found in the External Templates zip.  The differences are significant.  Similarly in the "App_LocalResources" subdirectory, there already is a ListPageMaster.ascx.resx and it is different than the one found in the External Templates.

    I have listed the code from the differing .ascx files below.
    Which files should I go with?  Should there not have been any of these files existing already in their directories (based on a clean install)? 

    Thanks.

    <%--ListPageMaster.ascx as installed--%>
     
    <%@ Control Language="C#" %>
    <%@ Register Assembly="Telerik.Cms" Namespace="Telerik.Cms.Web.UI" TagPrefix="sfCms" %>
     
    <telerik:CssFileLink ID="CssFileLink1" EmbeddedFileName="Telerik.News.Resources.ControlTemplates.Frontend.newsCommonLayout.css" FileName="" Media="screen" runat="server" />
     
     
    <script runat="server">
      
       protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
     
            foreach (RepeaterItem item in repeater.Items)
            {
                if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
                {
                    DynamicHyperLink link = item.FindControl("dhl") as DynamicHyperLink;
                    if (link != null)
                    {
                        link.PageId = new Guid("25b53b78-135b-4708-9e3e-fd8d5c24ce09");
                    }
                }
            }
        }
         
    </script>
     
    <asp:HyperLink ID="backLink" runat="server" Text="<%$Resources:GoBack %>"></asp:HyperLink>
    <asp:Repeater ID="repeater" runat="server">
        <HeaderTemplate>
            <ul class="sf_newsList">
        </HeaderTemplate>
        <ItemTemplate>
            <li>
                <h2 class="sf_newsTitle">
                    <asp:HyperLink ID="fullContent1" runat="server">
                        <asp:Literal ID="Title" runat="server"></asp:Literal>
                    </asp:HyperLink>
                </h2>
                <p class="sf_newsDate">
                    <asp:Literal ID="Publication_Date" runat="server" Text="{0}" />
                </p>
                <p>
                    <asp:Literal ID="Summary" runat="server" Text=""></asp:Literal>
                    <sfCms:DynamicHyperLink ID="dhl" runat="server" class="readMoreLink">
                        <asp:Literal ID="Literal1" runat="server" Text="Full Story"/>
                    </sfCms:DynamicHyperLink>
                </p>
                <p class="sf_readMore">
                    <asp:HyperLink ID="fullContent2" runat="server">
                        <asp:Literal ID="LiteralFS" runat="server" Text="<%$Resources:FullStory %>"></asp:Literal>
                    </asp:HyperLink>
                </p>
                <asp:PlaceHolder ID="ThumbnailHolder" runat="server">
                    <p class="sf_newsThumbnail"><asp:Image ID="Thumbnail" runat="server" /></p>
                </asp:PlaceHolder>
                <p class="sf_newsAuthor">
                        <asp:Literal ID="Author" runat="server"></asp:Literal>
                </p>
                <p>
                    <asp:Literal ID="Source" runat="server"></asp:Literal>
                </p>
                <p class="sf_postCategory">
                    <asp:HyperLink ID="Category" runat="server" />
                </p>
                <p class="sf_postTags">
                    <asp:Repeater ID="Tags" runat="server">
                        <ItemTemplate>
                            <asp:HyperLink ID="tagLink" runat="server" />
                        </ItemTemplate>
                    </asp:Repeater>
                </p>
            </li>
        </ItemTemplate>
        <FooterTemplate>
            </ul>
        </FooterTemplate>
    </asp:Repeater>
    <telerik:Pager ID="pager1" runat="server">
        <LayoutTemplate>
            <asp:Repeater ID="PageRepeaterLinkButton" runat="server">
                <HeaderTemplate>
                    <ol class="sf_pager">
                    <li><asp:LinkButton ID="PreviousPage" runat="server" Text="<%$Resources:PreviousPage %>"></asp:LinkButton></li>
                </HeaderTemplate>
                <ItemTemplate>
                    <li>
                        <asp:LinkButton ID="SingleItem" runat="server" />
                    </li>
                </ItemTemplate>
                <FooterTemplate>
                    <li><asp:LinkButton ID="NextPage" runat="server" Text="<%$Resources:NextPage %>"></asp:LinkButton></li>
                    </ol>
                </FooterTemplate>
            </asp:Repeater>
            <asp:Repeater ID="PageRepeaterHyperLink" runat="server">
                <HeaderTemplate>
                    <ol class="sf_pager">
                    <li><asp:HyperLink ID="PreviousPage" runat="server" Text="<%$Resources:PreviousPage %>"></asp:HyperLink></li>
                </HeaderTemplate>
                <ItemTemplate>
                    <li>
                        <asp:HyperLink ID="SingleItem" runat="server" />
                    </li>
                </ItemTemplate>
                <FooterTemplate>
                    <li><asp:HyperLink ID="NextPage" runat="server" Text="<%$Resources:NextPage %>"></asp:HyperLink></li>
                    </ol>
                </FooterTemplate>
            </asp:Repeater>
        </LayoutTemplate>
    </telerik:Pager><b>External Template</b>

    <%--ListPageMaster.ascx from External Templates zip--%>
    <%@ Control Language="C#" %>
     
    <telerik:CssFileLink ID="CssFileLink1" EmbeddedFileName="Telerik.News.Resources.ControlTemplates.Frontend.newsCommonLayout.css" FileName="" Media="screen" runat="server" />
     
    <asp:HyperLink ID="backLink" runat="server" Text="<%$Resources:GoBack %>"></asp:HyperLink>
    <asp:Repeater ID="repeater" runat="server">
        <HeaderTemplate>
            <ul class="sf_newsList">
        </HeaderTemplate>
        <ItemTemplate>
            <li>
                <h2 class="sf_newsTitle">
                    <asp:HyperLink ID="fullContent1" runat="server">
                        <asp:Literal ID="Title" runat="server"></asp:Literal>
                    </asp:HyperLink>
                </h2>
                <p class="sf_newsDate">
                    <asp:Literal ID="Publication_Date" runat="server" Text="{0}" />
                </p>
                <p>
                    <asp:Literal ID="Summary" runat="server" Text=""></asp:Literal>
                </p>
                <p class="sf_readMore">
                    <asp:HyperLink ID="fullContent2" runat="server">
                        <asp:Literal ID="LiteralFS" runat="server" Text="<%$Resources:FullStory %>"></asp:Literal>
                    </asp:HyperLink>
                </p>
                <asp:PlaceHolder ID="ThumbnailHolder" runat="server">
                    <p class="sf_newsThumbnail"><asp:Image ID="Thumbnail" runat="server" /></p>
                </asp:PlaceHolder>
                <p class="sf_newsAuthor">
                        <asp:Literal ID="Author" runat="server"></asp:Literal>
                </p>
                <p>
                    <asp:Literal ID="Source" runat="server"></asp:Literal>
                </p>
                <p class="sf_postCategory">
                    <asp:HyperLink ID="Category" runat="server" />
                </p>
                <p class="sf_postTags">
                    <asp:Repeater ID="Tags" runat="server">
                        <ItemTemplate>
                            <asp:HyperLink ID="tagLink" runat="server" />
                        </ItemTemplate>
                    </asp:Repeater>
                </p>
            </li>
        </ItemTemplate>
        <FooterTemplate>
            </ul>
        </FooterTemplate>
    </asp:Repeater>
    <telerik:Pager ID="pager1" runat="server">
        <LayoutTemplate>
            <asp:Repeater ID="PageRepeaterLinkButton" runat="server">
                <HeaderTemplate>
                    <ol class="sf_pager">
                    <li><asp:LinkButton ID="PreviousPage" runat="server" Text="<%$Resources:PreviousPage %>"></asp:LinkButton></li>
                </HeaderTemplate>
                <ItemTemplate>
                    <li>
                        <asp:LinkButton ID="SingleItem" runat="server" />
                    </li>
                </ItemTemplate>
                <FooterTemplate>
                    <li><asp:LinkButton ID="NextPage" runat="server" Text="<%$Resources:NextPage %>"></asp:LinkButton></li>
                    </ol>
                </FooterTemplate>
            </asp:Repeater>
            <asp:Repeater ID="PageRepeaterHyperLink" runat="server">
                <HeaderTemplate>
                    <ol class="sf_pager">
                    <li><asp:HyperLink ID="PreviousPage" runat="server" Text="<%$Resources:PreviousPage %>"></asp:HyperLink></li>
                </HeaderTemplate>
                <ItemTemplate>
                    <li>
                        <asp:HyperLink ID="SingleItem" runat="server" />
                    </li>
                </ItemTemplate>
                <FooterTemplate>
                    <li><asp:HyperLink ID="NextPage" runat="server" Text="<%$Resources:NextPage %>"></asp:HyperLink></li>
                    </ol>
                </FooterTemplate>
            </asp:Repeater>
        </LayoutTemplate>
    </telerik:Pager>
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    09 Mar 2010
    Link to this post
    Hello Clancy,

    A completely new project installed with Sitefinity_3_7_2022_community.exe does not contain any external templates in News folder. You must have added the template that contains DynamicHyperLink. However you should use ListPageMaster.ascx from External Templates zip archive.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
    Answered
2 posts, 1 answered