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

Forums / Developing with Sitefinity / Cant get an external template to work...

Cant get an external template to work...

3 posts, 0 answered
  1. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    05 Mar 2010
    Link to this post
    I've edited my Add_Data Configuration file to point to my downloaded external templates...and the news items work great.  However I cant seem to get the List items to pickup and work.  Specifically the ListItems on the admin side.  My "List" is essentially some By-laws, so the content is extremely long so I wanted to add a div with some jQuery to hide\show the items (easy to do), however modifying the template listed below has zero effect...am I doing something wrong?

    (I have restarted IIS a bunch of times too :/)

    Ideas?
    Steve


    <?xml version="1.0" encoding="utf-8" ?>
    <controlsConfig>
        <viewMap>
            <!-- Insert a new news item template -->
            <viewSettings hostType="Telerik.News.WebControls.NewsView">
                <additionalTemplates>
                    <!--Provides user interface for displaying a list of news items in the NewsView control for the News module.-->
                    <add key="ItemListTemplatePath" layoutTemplatePath="~/ExternalTemplates/Sitefinity/ControlTemplates/News/ListPageMaster.ascx" />
                    <!--Provides user interface for displaying a single news item in the NewsView control of the News module.-->
                    <add key="SingleItemTemplatePath" layoutTemplatePath="~/ExternalTemplates/Sitefinity/ControlTemplates/News/ListPageDetails.ascx" />
     
                </additionalTemplates>
            </viewSettings>
            <viewSettings hostType="Telerik.News.WebControls.Admin.NewsItemsList" layoutTemplatePath="~/ExternalTemplates/Sitefinity/Admin/ControlTemplates/News/NewsItemsList.ascx" />
            <!--Displays all lists-->
            <viewSettings hostType="Telerik.Lists.WebControls.Admin.ListsAll`1[[Telerik.Lists.WebControls.Admin.AllListsView, Telerik.Lists]]" layoutTemplatePath="~/ExternalTemplates/Sitefinity/Admin/ControlTemplates/Lists/ListsAll.ascx" />
            <!--Inserts a list-->
            <viewSettings hostType="Telerik.Lists.WebControls.Admin.ListInsert`1[[Telerik.Lists.WebControls.Admin.AllListsView, Telerik.Lists]]" layoutTemplatePath="~/ExternalTemplates/Sitefinity/Admin/ControlTemplates/Lists/ListInsert.ascx" />
            <!--Edits a list-->
            <viewSettings hostType="Telerik.Lists.WebControls.Admin.ListEdit`1[[Telerik.Lists.WebControls.Admin.AllListsView, Telerik.Lists]]" layoutTemplatePath="~/ExternalTemplates/Sitefinity/Admin/ControlTemplates/Lists/ListEdit.ascx" />
            <!--Displays all items of a list-->
            <viewSettings hostType="Telerik.Lists.WebControls.Admin.ListItemsAll`1[[Telerik.Lists.WebControls.Admin.AllListsView, Telerik.Lists]]" layoutTemplatePath="~/ExternalTemplates/Sitefinity/Admin/ControlTemplates/Lists/ListItemsAll.ascx" />
            <!--Edits a list item-->
            <viewSettings hostType="Telerik.Lists.WebControls.Admin.ListItemEdit`1[[Telerik.Lists.WebControls.Admin.AllListsView, Telerik.Lists]]" layoutTemplatePath="~/ExternalTemplates/Sitefinity/Admin/ControlTemplates/Lists/ListItemEdit.ascx" />
            <!--Inserts a list item-->
            <viewSettings hostType="Telerik.Lists.WebControls.Admin.ListItemInsert`1[[Telerik.Lists.WebControls.Admin.AllListsView, Telerik.Lists]]" layoutTemplatePath="~/ExternalTemplates/Sitefinity/Admin/ControlTemplates/Lists/ListItemInsert.ascx" />
            <!--Displays permissions for the Lists module-->
            <viewSettings hostType="Telerik.Lists.WebControls.Admin.PermissionsView`1[[Telerik.Lists.WebControls.Admin.ListsControlPanel, Telerik.Lists]]" layoutTemplatePath="~/ExternalTemplates/Sitefinity/Admin/ControlTemplates/Lists/PermissionsView.ascx" />
            <viewSettings hostType="Telerik.Lists.Design.ListsControlDesigner" layoutTemplatePath="~/ExternalTemplates/Sitefinity/ControlTemplates/Lists/ListsDesignerView.ascx" />
            <viewSettings hostType="Telerik.Lists.WebControls.ListDisplay">
                <additionalTemplates>
                    <!--Simple list-->
                    <add key="SimpleListTemplatePath" layoutTemplatePath="~/ExternalTemplates/Sitefinity/ControlTemplates/Lists/SimpleListView.ascx" />
                    <!--Expanded list-->
                    <add key="ExpandedListTemplatePath" layoutTemplatePath="~/ExternalTemplates/Sitefinity/ControlTemplates/Lists/ExpandedListView.ascx" />
                    <!--Expandable list-->
                    <add key="ExpandableListTemplatePath" layoutTemplatePath="~/ExternalTemplates/Sitefinity/ControlTemplates/Lists/ExpandableListView.ascx" />
                    <!--Anchor list-->
                    <add key="AnchorListTemplatePath" layoutTemplatePath="~/ExternalTemplates/Sitefinity/ControlTemplates/Lists/AnchorListView.ascx" />
                    <!--Page list-->
                    <add key="PageListTemplatePath" layoutTemplatePath="~/ExternalTemplates/Sitefinity/ControlTemplates/Lists/PageListView.ascx" />
                    <!--Simple Rotating list-->
                    <add key="RotatingListsSimpleTemplatePath" layoutTemplatePath="~/ExternalTemplates/Sitefinity/ControlTemplates/Lists/RotatingListsSimpleView.ascx" />
                    <!--Expanded Rotating list-->
                    <add key="RotatingListsExpandedTemplatePath" layoutTemplatePath="~/ExternalTemplates/Sitefinity/ControlTemplates/Lists/RotatingListsExpandedView.ascx" />
                </additionalTemplates>
            </viewSettings>
            <viewSettings hostType="Telerik.Lists.WebControls.ListSelector" layoutTemplatePath="~/ExternalTemplates/Sitefinity/ControlTemplates/Lists/ListSelectorView.ascx" />
        </viewMap>
    </controlsConfig>
  2. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    05 Mar 2010
    Link to this post
    **EDIT**

    Looks like after I added them all in, then went back and edited one of the items, it posted back and I'm now using my external template.....hmmm, oh well

    Non issue I guess, nevermind :)
  3. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    05 Mar 2010
    Link to this post
    Here's the template if anyone needs it...all the items are collapsed to begin with, and it does a jQuery slidetoggle to show the content

    (ListItemsAll.ascx)

    Steve

    <%@ Control Language="C#" %>
    <%@ Register TagPrefix="sfLst" Namespace="Telerik.Lists.WebControls" Assembly="Telerik.Lists" %>
     
    <script runat="server">
        protected void Item_DataBound(object sender, RepeaterItemEventArgs e) {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) {
                Label content = e.Item.FindControl("Content") as Label;
                HtmlControl header = e.Item.FindControl("itemheader") as HtmlControl;
                HtmlControl hidediv = e.Item.FindControl("hidediv") as HtmlControl;
     
                header.Attributes.Add("onclick", String.Format("HideShow('{0}')", hidediv.ClientID.ToString()));
            }
        }
    </script>
     
    <style type="text/css">
        .itemheader:hover{
            color: #4B679F;
        }
    </style>
     
    <div id="showOnLoad" style="display:none;">
    <div id="pnlToolsAll" runat="server" class="ToolsAll">
        <div class="backWrapp">
            <asp:HyperLink ID="backButton" runat="server" CausesValidation="false" Text="<%$Resources:BackToAllLists %>" CssClass="actions back"></asp:HyperLink>
        </div>
    </div>
    <div id="divWorkArea" runat="server" class="workArea">
        <telerik:MessageControl runat="server" ID="messageControl">
            <ItemTemplate>
                <asp:Label runat="server" ID="messageText"></asp:Label>
            </ItemTemplate>
        </telerik:MessageControl>
        <div class="mainForm">
            <div id="pnlHeader" runat="server" class="listHeader">
                <h1>
                    <asp:Literal ID="listTitle" runat="server"/>
                </h1>
                <asp:HyperLink ID="renameButton" runat="server" Text="<%$Resources:Rename %>"></asp:HyperLink>
            </div>
            <asp:Repeater ID="listItems" runat="server" OnItemDataBound="Item_DataBound">
                <HeaderTemplate>
                    <p class="button_area lc">
                        <asp:HyperLink ID="addNewListItemButton" runat="server" cssClass="CmsButLeft new">
                            <strong class="CmsButRight light">
                                <asp:Literal ID="Literal1" runat="server" Text="<%$Resources:AddNewListItem %>" />
                            </strong>
                        </asp:HyperLink>
                    </p>
                </HeaderTemplate>
                <ItemTemplate>
                        <div class="set listItem">
                            <div class="setIn">
                                <h3 id="itemheader" class="itemheader" runat="server" style="cursor:pointer; margin-bottom:15px;"><asp:Label ID="Headline" runat="server" Text='<%# Eval("Headline") %>'></asp:Label></h3>
                                 
                                <div id="hidediv" runat="server" style="display:none">
                                    <asp:Label ID="Content" runat="server"></asp:Label>
                                </div>                          
                                 
                                <asp:PlaceHolder ID="buttons" runat="server">
                                    <div class="listItemCommands">
                                        <asp:HyperLink ID="edit" runat="server" CommandName="edit" Text="<%$Resources:Edit %>" CssClass="editItemDetails"></asp:HyperLink>
                                        |
                                        <asp:LinkButton ID="delete" runat="server" CommandName="delete" Text="<%$Resources:Delete %>"></asp:LinkButton>
                                          <asp:Literal ID="Literal2" runat="server" Text="<%$Resources:Move %>"/> :
                                        <asp:LinkButton ID="up" runat="server" CommandName="moveUp" Text="<%$Resources:Up %>"></asp:LinkButton>
                                        |
                                        <asp:LinkButton ID="down" runat="server" CommandName="moveDown" Text="<%$Resources:Down %>"></asp:LinkButton>
                                    </div>
                                </asp:PlaceHolder>
                            
                            </div>
                        </div>
                        <div class="bottom"><div><!-- --></div></div>
                                    
                </ItemTemplate>
                <FooterTemplate>
                    </ol>
                    <asp:HyperLink ID="addNewListItemButton2" runat="server" cssClass="CmsButLeft new">
                        <strong class="CmsButRight light">
                            <asp:Literal ID="Literal3" runat="server" Text="<%$Resources:AddNewListItem %>"/>
                        </strong>
                    </asp:HyperLink>
                </FooterTemplate>
            </asp:Repeater>
            <div id="pnlBackToAllLists" runat="server" class="fin">
                <div class="setD">
                <p class="setInD">
                    <asp:Literal ID="Literal4" runat="server" Text="<%$Resources:Finished %>"/>
                    <asp:HyperLink ID="backButton2" runat="server" Text="<%$Resources:BackToAllLists %>" />
                </p>
                </div>
                <div class="bottomD"><div><!-- --></div></div>
            </div>
        </div>
        <div class="info" id="divFaq" runat="server">
        <div class="infoBottom">
           <h3><asp:Literal ID="Literal5" runat="server" Text="<%$Resources:ListsFAQ %>"/></h3>
            <asp:Literal ID="Literal6" runat="server" Text="<%$Resources:ListsFAQText %>"/>
            <p class="hideAllFAQs">
                <a href="javascript:void(0)" onclick="javascript:Personalization.hideFaqSection('<%= divFaq.ClientID %>')">Hide FAQs everywhere</a>
            </p>
            </div>
        </div>
        <div class="clear"><!-- --></div>
    </div>
    </div>
    <script type="text/javascript">
        function HideShow(id) {
            var item = $telerik.$("#" + id);
            item.slideToggle();
        }
    </script>
Register for webinar
3 posts, 0 answered