NewsItems and Comments

Posted by Community Admin on 04-Aug-2018 03:19

NewsItems and Comments

All Replies

Posted by Community Admin on 17-Oct-2011 00:00

I am attempting to get a listing of all of the published NewsItems and the comments that have been posted in regards to them. I am returning all of the published NewsItems with the code below. However when I loop through the NewsItems the Comments.Count for the items are always zero. I have verified that there are many NewsItems that have published comments.

As a side note I have also italicized and bolded a typo I have found when using the fluent API

Thanks,

Tony Concialdi

Public Shared Function GetAllNewsFluent() As IQueryable(Of NewsItem)
        Return App.WorkWith().NewsItems().Publihed().[Get]()
End Function


Dim AllSitefinityNewsItems = GetAllNewsFluent()

For Each item As NewsItem In AllSitefinityNewsItems
            Dim curNewsLink As New NewsLink
            curNewsLink.strURL = item.Urls(0).Url
            curNewsLink.intShares = item.Comments.Count

            If curNewsLink.intShares > 0 Then
                NewsList.Add(curNewsLink)
            End If
Next



Posted by Community Admin on 19-Oct-2011 00:00

Hi Tony,

Please find attached a sample template which counts the number of comments for blog post programatically and displays them in a Literal control on the frontend, I hope you find it useful.



Kind regards,
Boyan Barnev
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed