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

Forums / General Discussions / customize generic content list widget layout

customize generic content list widget layout

4 posts, 0 answered
  1. MJia
    MJia avatar
    44 posts
    Registered:
    09 Jun 2009
    31 Dec 2010
    Link to this post
    Hi, I tried to customize the generic content list widget by assign a template ascx page to the 'LayoutTemplatePath' property.  I found the default template code from the forum:

    <%@ 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" %>
      
    <telerik:RadListView ID="List" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
        <LayoutTemplate>
            <ul class="sfgenericList">
                <asp:PlaceHolder ID="ItemsContainer" runat="server" />
            </ul>
        </LayoutTemplate>
        <ItemTemplate>
            <li class="sfgenericListItem">
                <h2 class="sfgenericTitle">
                    <sf:DetailsViewHyperLink ID="DetailsViewHyperLink1" TextDataField="Title" ToolTipDataField="Description" runat="server" />
                </h2>
                <p class="sfgenericMetaInfo">
                    <sf:FieldListView ID="PublicationDate" runat="server" Format="{PublicationDate.ToLocal():MMM dd, yyyy}" />
                    <sf:DetailsViewHyperLink ID="itemCommentsLink" runat="server" CssClass="sfgenericCommentsCount" />
                </p>
            </li>
        </ItemTemplate>
    </telerik:RadListView>
    <sf:Pager id="pager" runat="server" NavigationMode="Links"></sf:Pager>

    It works but now I need to show the content of the item in the list.  I try to implement a collapse/expand feature in the list page.

    So how do I pull out the content of each item into the list?

    Thanks.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    31 Dec 2010
    Link to this post
    Hi MJia,

    You can use jQuery and its show/hide effects.

    Regards,
    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
  3. MJia
    MJia avatar
    44 posts
    Registered:
    09 Jun 2009
    03 Jan 2011
    Link to this post
    Thanks Ivan but that's not I was asking, I know how to use jquery to make show/hide effects.

    I was asking how to retrieve the 'content' of the items in the template ascx page?
    I tried to use the following code in the <itemtemplate>:

    <sf:FieldListView ID="Content" runat="server" Format=" />

    But it doesn't get me anything.

    Thanks.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    03 Jan 2011
    Link to this post
    Hi MJia,

    Try using an Eval

    <asp:Literal ID="Literal4" Text='<%# Eval("Content") %>' runat="server" />


    Regards,
    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
4 posts, 0 answered