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

Forums / Developing with Sitefinity / Determining if External Template Used

Determining if External Template Used

3 posts, 0 answered
  1. Armysniper
    Armysniper avatar
    126 posts
    Registered:
    03 Mar 2005
    31 Aug 2009
    Link to this post
    Is there a quick way to determine if an external template is being used versus the internal template?

    I am basically tying to change the control to use H3 versus H2, and H4 Versus H3 as shown:
    <%@ Control Language="C#" %> 
    <telerik:CssFileLink ID="CssFileLink1" EmbeddedFileName="Telerik.Lists.Resources.ControlTemplates.Frontend.listsCommonLayout.css" FileName="" Media="screen" runat="server" /> 
    <telerik:JsFileLink ID="JsFileLink1" EmbeddedFileName="Telerik.Lists.Resources.ExpandableList.js" FileName="" runat="server" /> 
     
    <asp:Repeater ID="lists" runat="server">  
        <ItemTemplate> 
            <h4 class="sf_listTitle"><asp:Literal ID="listTitle" runat="server"></asp:Literal></h4>  
              
            <class="sf_controlListItems">  
                <id="expandAll" runat="server">  
                    <asp:Literal ID="Literal1" runat="server" Text="<%$Resources:ExpandAll %>"></asp:Literal> 
                </a> 
                <id="collapseAll" runat="server" style="display:none;">  
                    <asp:Literal ID="Literal2" runat="server" Text="<%$Resources:CollapseAll %>"></asp:Literal> 
                </a> 
            </p> 
            <ul class="sf_expandableList" id="expandableList" runat="server">  
                <asp:Repeater ID="listItems" runat="server">  
                    <ItemTemplate> 
                        <li> 
                            <h3 id="headlineContainer" runat="server" class="sf_listItemTitle">  
                                <id="headline" runat="server" title="<%$Resources:ClickToExpand %>"></a> 
                            </h3> 
                            <div id="contentContainer" runat="server" class="sf_listItemBody" style="display:none;">  
                                <asp:Literal ID="content" runat="server"></asp:Literal> 
                            </div> 
                        </li> 
                    </ItemTemplate> 
                </asp:Repeater> 
            </ul> 
        </ItemTemplate> 
    </asp:Repeater> 
    Here is my config file for my override:
    <?xml version="1.0" encoding="utf-8" ?> 
    <controlsConfig> 
      <viewMap> 
        <viewSettings hostType="Telerik.Cms.Engine.WebControls.ContentView">  
          <additionalTemplates> 
            <!--Provides user interface for displaying a list of content items in the ContentView control in the GenericContent module.--> 
            <add key="ItemListTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Generic_Content/ContentViewItemList.ascx" /> 
          </additionalTemplates> 
        </viewSettings> 
        <viewSettings hostType="Telerik.Lists.WebControls.ListDisplay">  
          <additionalTemplates> 
            <!--Simple list--> 
            <!--<add key="SimpleListTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Lists/SimpleListView.ascx" />--> 
            <!--Expanded list--> 
            <!--<add key="ExpandedListTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Lists/ExpandedListView.ascx" />--> 
            <!--Expandable list--> 
            <add key="ExpandableListTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Lists/ExpandableListView.ascx" /> 
            <!--Anchor list--> 
            <!--<add key="AnchorListTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Lists/AnchorListView.ascx" />--> 
            <!--Page list--> 
            <!--<add key="PageListTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Lists/PageListView.ascx" />--> 
            <!--Simple Rotating list--> 
            <!--<add key="RotatingListsSimpleTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Lists/RotatingListsSimpleView.ascx" />--> 
            <!--Expanded Rotating list--> 
            <!--<add key="RotatingListsExpandedTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/Lists/RotatingListsExpandedView.ascx" />--> 
          </additionalTemplates> 
        </viewSettings> 
      </viewMap> 
    </controlsConfig> 
     
     
    I do not see any changes when I change the code from H2 to H3 and H3 to H4. So what am I missing?

  2. Armysniper
    Armysniper avatar
    126 posts
    Registered:
    03 Mar 2005
    31 Aug 2009
    Link to this post
    Ignore me...:) its the old...reset the application to get your config file to kick in deal. ;) Thank you Ivan for your blog! ;)
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    31 Aug 2009
    Link to this post
    Hi Armysniper,

    1. Remove CssFileLink and JsFileLink declarations from the template if you are not going to use them or change the FileName  to your custom css or js files.

    2. Use ExpandableListTemplatePath property of ListDisplay control to map the template.

    Actually when you map a template generally it is expected that you have modified it or at least there is a simple change to the html which should be visible. There is no indicator in the control or somewhere in the admin that shows which templates are mapped ( settings are stored in ControlsConfig file).

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
3 posts, 0 answered