public static string GetContentLink(ContentHead head) { SiteService site = new SiteService(); if (!String.IsNullOrEmpty(head.ExternalLinkUrl)) return head.ExternalLinkUrl; if (site.IgnoreVirtualAppPath) return head.Location + head.CanonicalName; else return AppName + head.Location + head.CanonicalName; }
protected override void InitializePage() { base.InitializePage(); string id = this.TempData["id"] as string; SiteService site = new Box.CMS.Services.SiteService(); HEAD = site.GetContent(id); if (HEAD == null) throw new System.Web.HttpException(404, "page not found"); site.LogPageView(id); CONTENT_URL = Request.Url.Scheme + "://" + Request.Url.Host + (Request.Url.Port!=80?":" + Request.Url.Port:"") + HEAD.Location+HEAD.CanonicalName; CONTENT = HEAD.CONTENT; }
public static string ContentTags(ContentHead content) { string str = String.Empty; foreach (ContentTag tag in content.Tags) { str = str + ", " + tag.Tag; } if (str.Length <= 2) return str; return str.Substring(2); }
public static IHtmlString ContentLink(ContentHead content) { return new HtmlString("<a href=\"" + BoxLib.GetContentLink(content) + "\" title=\"" + content.Name + "\">" + content.Name + "</a>"); }