public ReplyModel(XmlNode node) { this.AuthorName = node.SelectSingleNode("Author/Username").InnerText; this.Body = CommunityHelper.FormatString100(node.SelectSingleNode("Body").InnerText); this.ReplyDate = UnderstoodDotOrg.Common.Helpers.DataFormatHelper.FormatDate(node.SelectSingleNode("Date").InnerText); this.Date = Convert.ToDateTime((node.SelectSingleNode("Date").InnerText)); this.ContentId = node.SelectSingleNode("ContentId").InnerText; this.ContentTypeId = node.SelectSingleNode("ContentTypeId").InnerText; }
protected void Page_Load(object sender, EventArgs e) { BlogsPostPageItem blogCig = new BlogsPostPageItem(Sitecore.Context.Item); litFormattedDate.Text = blogCig.Date.DateTime.ToString("M/dd/yyyy"); BlogsAuthorPageItem author = Sitecore.Context.Database.GetItem(blogCig.Author.Raw); linkAuthor.HRef = linkAuthor2.HRef = linkAuthor3.HRef = LinkManager.GetItemUrl(author); litAuthorBio.Text = CommunityHelper.FormatString100(author.Biography.Text) + "..."; litAuthor.Text = litAuthor2.Text = author.Name; }
private void Page_Load(object sender, EventArgs e) { string blogId = Request.QueryString["BlogId"]; List <UnderstoodDotOrg.Domain.TelligentCommunity.BlogPost> dataSource = CommunityHelper.ListBlogPosts(blogId, "100"); foreach (var item in dataSource) { BlogsPostPageItem blogPost = Sitecore.Context.Database.GetItem("/Sitecore/Content/Home/Community and Events/Blogs/" + item.BlogName + "/" + item.Title); item.Author = blogPost.Author.Rendered; item.Body = CommunityHelper.FormatString100(CommunityHelper.FormatRemoveHtml(blogPost.Body.Raw)); item.AuthorUrl = "/Community and Events/Blogs/Author/" + item.Author; } rptBlogInfo.DataSource = dataSource; rptBlogInfo.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { var commentsList = TelligentService.ReadComments(Settings.GetSetting(Constants.Settings.TelligentBlogIds)); if (commentsList.Any()) { litAuthor.Text = commentsList[0].AuthorDisplayName; litCommentSnippet.Text = CommunityHelper.FormatString100(commentsList[0].Body); litDateTime.Text = commentsList[0].PublishedDate; string[] s = commentsList[0].ParentTitle.Split('{'); litTitle.Text = s[0]; linkReadMore.HRef = linkTitle.HRef = commentsList[0].Url; } else { this.Visible = false; } }