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.
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>
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With