public static void SetFalloverValues(this WebPage webPage, Website website) { webPage.MetaTitle = FalloverMetaTitle(webPage, website); webPage.MetaAuthor = FalloverMetaAuthor(webPage, website); webPage.MetaDescription = FalloverMetaDescription(webPage); webPage.MetaKeywords = FalloverMetaKeywords(webPage); }
private static string FalloverMetaAuthor(this WebPage webPage, Website website) { if (!string.IsNullOrEmpty(webPage.MetaAuthor)) { return webPage.MetaAuthor; } return website.SiteName; }
private static string FalloverMetaTitle(WebPage webPage, Website website) { if (string.IsNullOrEmpty(webPage.MetaTitle)) { webPage.MetaTitle = webPage.Name; } webPage.MetaTitle = string.Format("{0} | {1}", webPage.MetaTitle, website.SiteName); return webPage.MetaTitle; }
public Website MapWebsite(IPublishedContent currentPage) { IPublishedContent websitePage = currentPage.AncestorsOrSelf("Website").FirstOrDefault(); if (websitePage == null) { throw new NullReferenceException("No ancestor or self Website document type found."); } var website = new Website(); _umbracoMapper.Map(websitePage, website); return website; }