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; }
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(); }
public void Merge(SEOInfo other) { if (other != null) { Merge(other.PageTitle, other.MetaKeywords, other.MetaDescription); } }