How to retrive number of comment, Taglist and categories of blogpost
Hi Team,
How to retrive Comment count, Categories list and Tagslist from blog post in my custom template. I want post should display like below. Please provide some sample template.
'Title of Blog post'
05/18/11 | 10 Comments | Tags: Natural Gas, South Africa, Mpumalanga plant
Please help..
Thanks & Regards,
Pravat sharma.
Hello Pravat,
The comments count is displayed via a CommentsBox control, and for the Tags, you will need to add a FlatTaxonField control on your template. Basically this:
<%@ Control Language="C#" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Comments" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Import Namespace="Telerik.Sitefinity" %>
<
telerik:RadListView
ID
=
"Repeater"
ItemPlaceholderID
=
"ItemsContainer"
runat
=
"server"
EnableEmbeddedSkins
=
"false"
EnableEmbeddedBaseStylesheet
=
"false"
>
<
LayoutTemplate
>
<
sf:ContentBrowseAndEditToolbar
ID
=
"MainBrowseAndEditToolbar"
runat
=
"server"
Mode
=
"Add"
></
sf:ContentBrowseAndEditToolbar
>
<
ul
class
=
"sfpostsList sfpostListTitleDateContent"
>
<
asp:PlaceHolder
ID
=
"ItemsContainer"
runat
=
"server"
/>
</
ul
>
</
LayoutTemplate
>
<
ItemTemplate
>
<
li
class
=
"sfpostListItem"
>
<
h2
class
=
"sfpostTitle"
>
<
sf:DetailsViewHyperLink
TextDataField
=
"Title"
ToolTipDataField
=
"Description"
runat
=
"server"
/>
</
h2
>
<
div
class
=
"sfpostAuthorAndDate"
>
<
asp:Literal
ID
=
"Literal2"
Text="<%$ Resources:Labels, By %>" runat="server" />
<
sf:PersonProfileView
runat
=
"server"
/>
<
sf:FieldListView
ID
=
"PostDate"
runat
=
"server"
Format
=
" | PublicationDate.ToLocal():MMM dd, yyyy"
/>
</
div
>
<
sf:FieldListView
ID
=
"PostContent"
runat
=
"server"
Text
=
"0"
Properties
=
"Content"
WrapperTagName
=
"div"
WrapperTagCssClass
=
"sfpostContent"
/>
<
sf:CommentsBox
ID
=
"itemCommentsLink"
runat
=
"server"
CssClass
=
"sfpostCommentsCount"
/>
<
div
class
=
"sfpostCategoriesAndTagsWrp"
>
<
sitefinity:FlatTaxonField
ID
=
"FlatFieldControl"
DisplayMode
=
"Read"
BindOnServer
=
"true"
runat
=
"server"
TaxonomyId
=
"CB0F3A19-A211-48a7-88EC-77495C0F5374"
WebServiceUrl
=
"~/Sitefinity/Services/Taxonomies/FlatTaxon.svc"
Expanded
=
"false"
TaxonomyMetafieldName
=
"Tags"
Title
=
"Tags"
ResourceClassId
=
"TaxonomyResources"
HideWhenNoTaxaFound
=
"true"
CssClass
=
"sfpostTagsWrp"
/>
</
div
>
<
sf:ContentBrowseAndEditToolbar
ID
=
"BrowseAndEditToolbar"
runat
=
"server"
Mode
=
"Edit,Delete,Unpublish"
></
sf:ContentBrowseAndEditToolbar
>
</
li
>
</
ItemTemplate
>
</
telerik:RadListView
>
<
sf:Pager
id
=
"pager"
runat
=
"server"
></
sf:Pager
>
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>