예제 #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;
        }
예제 #2
0
파일: SiteInfo.cs 프로젝트: sigcms/Seeger
        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();
        }
예제 #3
0
파일: SEOInfo.cs 프로젝트: sigcms/Seeger
 public void Merge(SEOInfo other)
 {
     if (other != null)
     {
         Merge(other.PageTitle, other.MetaKeywords, other.MetaDescription);
     }
 }