Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I make Orchard show the entirety of a blog post in the blog list?

I just set up Orchard and noticed that the preview widget only shows the first couple sentences with the standard "more" link. Is there a way to override this functionality without creating a custom widget? I would like Orchard to show the entirety of my latest five posts.

like image 764
Matthew Kruskamp Avatar asked Feb 20 '11 10:02

Matthew Kruskamp


2 Answers

Sure, just put this Parts.Common.Body.Summary.cshtml in the views directory of your theme:

@{
    Orchard.ContentManagement.ContentItem contentItem = Model.ContentPart.ContentItem;
    var bodyHtml = new HtmlString(Model.Html.ToString());
}

<p>@bodyHtml</p>
like image 128
Bertrand Le Roy Avatar answered Sep 28 '22 03:09

Bertrand Le Roy


I wanted to do something similar without overriding the Common.Body.Summary part for the whole site. I only wanted BlogPosts to use the full HTML for the Summary. I think I've accomplished this by adding the following line to Placement.info:

<Match ContentType="BlogPost">
    <Match DisplayType="Summary">
        <Place Parts_Common_Body_Summary="Content:after;Alternate=Parts_Common_Body"/>
    </Match>
</Match>
like image 31
Josh Schultz Avatar answered Sep 28 '22 02:09

Josh Schultz