customize generic content list widget layout
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
>
Hi MJia,
You can use jQuery and its show/hide effects.
Regards,
Ivan Dimitrov
the Telerik team
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.
Hi MJia,
Try using an Eval
<
asp:Literal
ID
=
"Literal4"
Text='<%# Eval("Content") %>' runat="server" />