private void bindSectionShow(List <ContentPost> posts, ContentPost img) { IBlock block = getBlock("list"); foreach (ContentPost post in posts) { BinderUtils.bindPostSingle(block, post, ctx); block.Next(); } IBlock imgBlock = getBlock("img"); if (img != null) { imgBlock.Set("ipost.TitleCss", img.Style); String content = strUtil.HasText(img.Summary) ? img.Summary : strUtil.ParseHtml(img.Content, 50); imgBlock.Set("ipost.Content", content); int width = img.Width <= 0 ? 120 : img.Width; int height = img.Height <= 0 ? 90 : img.Height; imgBlock.Set("ipost.Width", width); imgBlock.Set("ipost.Height", height); imgBlock.Set("ipost.Url", alink.ToAppData(img, ctx)); imgBlock.Bind("ipost", img); imgBlock.Next(); } }
private void bindSectionPosts(IList posts) { IBlock block = getBlock("list"); foreach (ContentPost post in posts) { BinderUtils.bindPostSingle(block, post, ctx); block.Next(); } }
private void bindSectionShow(ContentSection section, List <ContentPost> posts) { set("m.Title", section.Title); IBlock block = getBlock("list"); foreach (ContentPost post in posts) { BinderUtils.bindPostSingle(block, post); block.Next(); } }
private void bindSectionShow(List <ContentPost> posts, ContentPost img) { IBlock block = getBlock("list"); foreach (ContentPost post in posts) { BinderUtils.bindPostSingle(block, post); block.Next(); } IBlock imgBlock = getBlock("img"); if (img != null) { imgBlock.Set("ipost.TitleCss", img.Style); imgBlock.Set("ipost.TitleFull", img.Title); if (strUtil.HasText(img.TitleHome)) { block.Set("ipost.Title", img.TitleHome); } else { block.Set("ipost.Title", img.Title); } if (img.ImgLink.StartsWith("/") || img.ImgLink.StartsWith("http://")) { imgBlock.Set("ipost.ImgUrl", img.ImgLink); } else { imgBlock.Set("ipost.ImgUrl", img.GetImgThumb()); } String content = strUtil.HasText(img.Summary) ? img.Summary : strUtil.ParseHtml(img.Content, 50); imgBlock.Set("ipost.Content", content); int width = img.Width <= 0 ? 120 : img.Width; int height = img.Height <= 0 ? 90 : img.Height; imgBlock.Set("ipost.Width", width); imgBlock.Set("ipost.Height", height); imgBlock.Set("ipost.Url", alink.ToAppData(img)); imgBlock.Bind("ipost", img); imgBlock.Next(); } }
private void bindPostList(ContentSection section, DataPage <ContentPost> posts, ContentSetting setting) { set("section.Name", section.Title); IBlock block = getBlock("list"); foreach (ContentPost post in posts.Results) { BinderUtils.bindPostSingle(block, post, ctx); if (setting.ArticleListMode == ArticleListMode.Summary) { block.Set("post.Summary", post.GetSummary(setting.SummaryLength)); } block.Next(); } }
private void bindSectionShow(List <ContentPost> posts, List <ContentPost> imgs) { IBlock block = getBlock("list"); foreach (ContentPost post in posts) { BinderUtils.bindPostSingle(block, post); block.Next(); } IBlock imgBlock = getBlock("imgs"); foreach (ContentPost img in imgs) { imgBlock.Set("img.TitleFull", img.Title); imgBlock.Set("img.TitleCss", img.Style); if (strUtil.HasText(img.TitleHome)) { imgBlock.Set("img.Title", img.TitleHome); } else { imgBlock.Set("img.Title", img.Title); } imgBlock.Set("img.Thumb", img.GetImgThumb()); imgBlock.Set("img.Url", alink.ToAppData(img)); imgBlock.Bind("img", img); imgBlock.Next(); } }