Esempio n. 1
0
        public static MetaInfo GetFormatedMetaInfo(MetaInfo meta, string name, string categoryName = null, string brandName = null, string price = null)
        {
            if (meta != null)
            {
                if (string.IsNullOrEmpty(meta.Title))
                {
                    meta.Title = SettingsSEO.GetDefaultTitle(meta.Type) ?? SettingsSEO.DefaultMetaTitle;
                }
                if (string.IsNullOrEmpty(meta.MetaKeywords))
                {
                    meta.MetaKeywords = SettingsSEO.GetDefaultMetaKeywords(meta.Type) ?? SettingsSEO.DefaultMetaKeywords;
                }
                if (string.IsNullOrEmpty(meta.MetaDescription))
                {
                    meta.MetaDescription = SettingsSEO.GetDefaultMetaDescription(meta.Type) ?? SettingsSEO.DefaultMetaKeywords;
                }
                if (string.IsNullOrEmpty(meta.H1))
                {
                    meta.H1 = SettingsSEO.GetDefaultH1(meta.Type) ?? SettingsSEO.DefaultH1;
                }

                meta.Title           = GlobalStringVariableService.TranslateExpression(meta.Title, meta.Type, name, categoryName, brandName, price);
                meta.MetaKeywords    = GlobalStringVariableService.TranslateExpression(meta.MetaKeywords, meta.Type, name, categoryName, brandName, price);
                meta.MetaDescription = GlobalStringVariableService.TranslateExpression(meta.MetaDescription, meta.Type, name, categoryName, brandName, price);
                meta.H1 = GlobalStringVariableService.TranslateExpression(meta.H1, meta.Type, name, categoryName, brandName, price);
            }
            return(meta);
        }
Esempio n. 2
0
 public static MetaInfo GetDefaultMetaInfo(MetaType metaType)
 {
     return(new MetaInfo(0, 0, metaType, SettingsSEO.GetDefaultTitle(metaType), SettingsSEO.GetDefaultMetaKeywords(metaType), SettingsSEO.GetDefaultMetaDescription(metaType)));
 }