Render comments part in custom theme

Topics: Customizing Orchard
Jan 25, 2013 at 2:30 PM
Edited Jan 25, 2013 at 2:32 PM


Been stuck on this for a while, hope to get some help.

I've made a custom view, Content-BlogPost.Detail.cshtml, styling of the post is all good and set but I just cannot find a way to render the comments + form. Obviously it works when i only put in @Display(Model.Content) in that view, I just cant figure out how i can access or just render the comments part.

Any pointers/help would be appreciated!


Here's the view now:

@using Orchard.Utility.Extensions;
    if (Model.Title != null) {
        Layout.Title = Model.Title;
    var contentTypeClassName = ((string)Model.ContentItem.ContentType).HtmlClassify();
    var Post = Model.ContentItem;
    var DT = DateTime.Parse(Post.CommonPart.CreatedUtc.ToString());
    var Url = Post.AutoroutePart.Path;
    var Title = Post.TitlePart.Title;
    var User = Post.BlogPostPart.Creator.UserName;
    var CommentsCount = Post.CommentsPart.Comments.Count;
    var Body = Post.BodyPart.Text;
    var CurrentTags = Post.TagsPart.CurrentTags;
<div class="span6 blog-summary primary-column">
<article class="entry-post">
    <header class="entry-header">
        <h3 class="entry-title"><a href="@Url">@Title</a></h3>
        <div class="byline">
	     <i class="e-icon-pencil"></i> @User &nbsp;&nbsp; 
	     <i class="e-icon-clock"></i> <abbr class="published" title="@DT.ToString()">@DT.ToString("MMMM d, yyyy")</abbr> &nbsp;&nbsp; 
            <i class="e-icon-chat"></i> @CommentsCount.ToString() comments &nbsp;&nbsp;
	     <a href="@Url"><i class="e-icon-link"></i>Permalink</a>
    <!--end entry-header -->

    <!--begin loop of entry-posts for summary page-->

    <div class="entry-content">
	@Display(New.BlogPostTagShape(Tags: CurrentTags))
    <!-- close entry-content -->

    <!-- Render Comments Here -->

    <footer class="entry-footer">
        <span class="blog date"><span class="month">@DT.ToString("MMM")</span> <span class="day">@DT.ToString("dd")</span> <span class="year">@DT.ToString("yyyy")</span> </span>
        <!--close date-->
    <!--end entry-footer-->


Feb 10, 2013 at 9:59 PM
Why don't you use placement?
Sep 6, 2014 at 8:28 AM
Edited Sep 6, 2014 at 9:03 AM
I have the exact same issue and don't see how placement can help me on this. Is it not possible to render a specific part?

EDIT: never mind, I found the solution using placement, thanks to the guidance of following blog post:

Above blog post made it clear to me I didn't want to go the non-placement route.