1: /// <summary>
2: /// Gets the body of the post. Important: use this instead of Post.Content.
3: /// </summary>
4: public string Body
5: {
6: get
7: {
8: string body = Post.Content;
9: if (ShowExcerpt)
10: {
11: string link = " <a href=\"" + Post.RelativeLink.ToString() + "\">[" + (Page as BlogBasePage).Translate("more") + "]</a>";
12:
13: if (!string.IsNullOrEmpty(Post.Description))
14: {
15: body = cleo.getImage(Post.Content) + Post.Description + link;
16: }
17: else
18: {
19: body = Utils.StripHtml(Post.Content);
20: if (body.Length > 300)
21: body = cleo.getImage(Post.Content) + body.Substring(0, 300) + "..." + link ;
22: }
23: }
24:
25: ServingEventArgs arg = new ServingEventArgs(body, this.Location);
26: Post.OnServing(Post, arg);
27:
28: if (arg.Cancel)
29: {
30: if (arg.Location == ServingLocation.SinglePost)
31: {
32: Response.Redirect("~/error404.aspx", true);
33: }
34: else
35: {
36: this.Visible = false;
37: }
38: }
39:
40: return arg.Body ?? string.Empty;
41: }
42: }