Example #1
0
        public ActionResult Permalink(PermalinkSetting model)
        {
            try
            {
                CurrentSite.SetPermalinkSetting(model);
                DataContext.SaveChanges();

                ShowSuccess(SusuCMS.MessageResource.UpdateSuccess);
            }
            catch
            {
                ShowError(SusuCMS.MessageResource.UpdateFailed);
            }

            return View(model);
        }
Example #2
0
        public static PermalinkSetting GetPermalinkSetting(this Site site)
        {
            var setting = site.GetData<PermalinkSetting>(BlogAreaRegistration.ModuleName, "PermalinkSetting");
            if (setting == null)
            {
                // return default setting
                setting = new PermalinkSetting
                {
                    ArticleUrl = "article/{ArticleId}/{Slug}",
                    CategoryUrl = "category/{CategoryId}/{Slug}",
                    TagUrl = "tag/{TagId}/{Slug}",
                    ArchiveUrl = "archive{Year}/{Month}"
                };
            }

            return setting;
        }
Example #3
0
 public static void SetPermalinkSetting(this Site site, PermalinkSetting setting)
 {
     site.SetData(BlogAreaRegistration.ModuleName, "PermalinkSetting", setting);
 }