コード例 #1
0
 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);
 }
コード例 #2
0
        private static string FalloverMetaAuthor(this WebPage webPage, Website website)
        {
            if (!string.IsNullOrEmpty(webPage.MetaAuthor))
            {
                return webPage.MetaAuthor;
            }

            return website.SiteName;
        }
コード例 #3
0
        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;
        }
コード例 #4
0
        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;
        }