How to restric the blog post content with 3 lines in home page.

Topics: Core, Customizing Orchard, General, Installing Orchard, Localization
May 3, 2013 at 8:44 AM
Hi,
The blog post contents are displayed with lines only in home page. When click on the title it navigates to summary page. In this page it shows complete content. Can you please let me know where the code resides to restrict to display 3 lines of code?

I have created a new feature to display list of bloggers list in home page. when click on the blogger name it shows the list of post created by that blogger. To this i need to restrict the content with 3 lines.

Can you please let me know how to implement this?
May 3, 2013 at 1:09 PM
The shape tracing tool is your friend for this one. However, if you look at the template for the blog summary you will pick up a code fragment such as
@{ 
    Orchard.ContentManagement.ContentItem contentItem = Model.ContentPart.ContentItem;
    string bodyHtml = Model.Html.ToString();
    var body = new HtmlString(Html.Excerpt(bodyHtml, 200).ToString().Replace(Environment.NewLine, "</p>" + Environment.NewLine + "<p>")); 
}
<p>@body</p> 
<div class="view-more">  
  @Html.ItemDisplayLink(T("Read more").ToString(), contentItem)
</div>
May 3, 2013 at 4:53 PM
This may be of interest to you as well if you'd like to have a custom amount of text be displayed in the summary view.

http://weblogs.asp.net/bleroy/archive/2012/07/01/my-body-summary-template-for-orchard.aspx