More in this section

Forums / Developing with Sitefinity / customizing the blog post view

customizing the blog post view

4 posts, 0 answered
  1. steve portock
    steve portock avatar
    8 posts
    Registered:
    23 Apr 2010
    19 May 2010
    Link to this post
    I want to customize my blog post view but i noticed a few things that I had questions on. There is an author, but nowhere does that get populated, So how does that work? I created a custom field to handle that for now, but is that really the best way to go about this? I also need the #of comments before they appear in the repeater that posts the the blog item responses. How do I get that number? I would also like to do some conditional output, I will be inserting custom code for audio and video posts, and some of this might wrap the content of the blog, so I might have situations where i would need to post some things around the blog post content, and not, how would you do that. I am really trying to stay away from a complete programmatic customization of this. Can anyone point me to any thing that can show me the way on this? I have hunted around the help but just cant seem to find what I am looking for here. Thanks.
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    19 May 2010
    Link to this post
    Hi steve portock,

    The author is populated from the parent blog to which this blog post posted. Each blog has Author setting which you fill in when create a blog. This is the design of blogs - one author per blog. You can get the comments count as in the custom control I have attached. What it will do is that it is going to look for a literal with ID commentsCount either in the repeater's ItemTemplate or in the single item template based in which mode you are (list or singe). Attached is a sample control illustrating the above.

    Sincerely yours,
    Radoslav Georgiev
    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. steve portock
    steve portock avatar
    8 posts
    Registered:
    23 Apr 2010
    19 May 2010
    Link to this post
    Radoslav,

    I am not sure how you would use this for what i want to do here. I need that count before the repeater renders, so using the find control would not help me if the item does not exist yet. Is there a way to simply call in code the items and get a count that way, given this screen, how do you guys pass around the ids to get things? I would much rather just write a simple call using the objects and get my count that way. Is that possible?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    19 May 2010
    Link to this post
    Hi steve portock,

    You could create a custom control that inherits from BlogPosts and override CreateChildControl and SetItemMetadata where you have access the the datasource and all content items. This will allow you to get the count/ number of comments and posts before rendering.
    Here is a forum post that shows how to create a custom control that inherits from BlogPosts - blog-posts-control


    Sincerely yours,
    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.
Register for webinar
4 posts, 0 answered