Example #1
0
 public static PageSetting GetPageSetting(string pageName, ApplicationKeyType applicationType = 1)
 {
     PageSetting setting = new PageSetting(pageName, applicationType, "Base");
     if (setting._title.IndexOf("{hostname}", StringComparison.Ordinal) > -1)
     {
         setting._title = ReplaceHostName(setting._title);
     }
     if (setting._keywords.IndexOf("{hostname}", StringComparison.Ordinal) > -1)
     {
         setting._keywords = ReplaceHostName(setting._keywords);
     }
     if (setting._description.IndexOf("{hostname}", StringComparison.Ordinal) > -1)
     {
         setting._description = ReplaceHostName(setting._description);
     }
     return setting;
 }
Example #2
0
 public static PageSetting GetContentClassSetting(Maticsoft.Model.CMS.ContentClass classModel, string pageName = "CMSSelf", ApplicationKeyType applicationType = 4)
 {
     if (classModel == null)
     {
         classModel = new Maticsoft.Model.CMS.ContentClass();
     }
     PageSetting setting = new PageSetting(pageName, applicationType, "Base");
     if (!string.IsNullOrWhiteSpace(classModel.Meta_Title))
     {
         setting._title = classModel.Meta_Title;
     }
     else
     {
         setting._title = ConfigSystem.GetValueByCache(setting.KeyTitle, setting._applicationType);
         if (string.IsNullOrWhiteSpace(setting._title))
         {
             setting._title = ConfigSystem.GetValueByCache("Title", ApplicationKeyType.System);
         }
     }
     if (!string.IsNullOrWhiteSpace(classModel.Meta_Keywords))
     {
         setting._keywords = classModel.Meta_Keywords;
     }
     else
     {
         setting._keywords = ConfigSystem.GetValueByCache(setting.KeyKeywords, setting._applicationType);
         if (string.IsNullOrWhiteSpace(setting._keywords))
         {
             setting._keywords = ConfigSystem.GetValueByCache("Keywords", ApplicationKeyType.System);
         }
     }
     if (!string.IsNullOrWhiteSpace(classModel.Meta_Description))
     {
         setting._description = classModel.Meta_Description;
     }
     else
     {
         setting._description = ConfigSystem.GetValueByCache(setting.KeyDescription, setting._applicationType);
         if (string.IsNullOrWhiteSpace(setting._description))
         {
             setting._description = ConfigSystem.GetValueByCache("Description", ApplicationKeyType.System);
         }
     }
     if (setting._title.IndexOf("{hostname}", StringComparison.Ordinal) > -1)
     {
         setting._title = ReplaceHostName(setting._title);
     }
     if (setting._keywords.IndexOf("{hostname}", StringComparison.Ordinal) > -1)
     {
         setting._keywords = ReplaceHostName(setting._keywords);
     }
     if (setting._description.IndexOf("{hostname}", StringComparison.Ordinal) > -1)
     {
         setting._description = ReplaceHostName(setting._description);
     }
     setting.Replace(new string[][] { new string[] { "{ctname}", classModel.ClassName }, new string[] { "{cateid}", classModel.ClassID.ToString() } });
     return setting;
 }