Beispiel #1
0
        public static SEOInfo GetSeoInfo(this PageItem page, CultureInfo culture, bool inheritParentSeoSettings = false)
        {
            var seo = new SEOInfo();

               if (culture != null)
               {
               seo.PageTitle = page.GetLocalized(x => x.PageTitle, culture);
               seo.MetaKeywords = page.GetLocalized(x => x.MetaKeywords, culture);
               seo.MetaDescription = page.GetLocalized(x => x.MetaDescription, culture);
               }
               else
               {
               seo.PageTitle = page.PageTitle;
               seo.MetaKeywords = page.MetaKeywords;
               seo.MetaDescription = page.MetaDescription;
               }

               if (inheritParentSeoSettings && page.Parent != null)
               {
               var parentSeo = page.Parent.GetSeoInfo(culture, true);
               seo.Merge(parentSeo);
               }

               return seo;
        }
Beispiel #2
0
        public SiteInfo(string culture)
        {
            Require.NotNullOrEmpty(culture, "culture");

            Culture = culture;
            SiteTitle = String.Empty;
            SiteSubtitle = String.Empty;
            LogoFilePath = String.Empty;
            Copyright = String.Empty;
            MiiBeiAnNumber = String.Empty;

            SEOInfo = new SEOInfo();
        }
Beispiel #3
0
 public void Merge(SEOInfo other)
 {
     if (other != null)
     {
         Merge(other.PageTitle, other.MetaKeywords, other.MetaDescription);
     }
 }