コード例 #1
0
 private void Instance_PublishingPage(object sender, ContentEventArgs e)
 {
     if (e.Content is SBRobotsTxt content)
     {
         Task.Run(async() => await SeoHelper.AddRoute());
     }
 }
コード例 #2
0
        public void Initialize(InitializationEngine context)
        {
            var contentRepository = ServiceLocator.Current.GetInstance <IContentRepository>();

            try
            {
                if (!ContentReference.IsNullOrEmpty(ContentReference.StartPage))
                {
                    var content = contentRepository.GetChildren <SBRobotsTxt>(ContentReference.StartPage);

                    if (content != null)
                    {
                        var list = content.ToList();

                        if (list.Any())
                        {
                            Task.Run(async() => await SeoHelper.AddRoute());
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogManager.GetLogger().Error("SEOBOOST Initialization", ex);
            }
        }
コード例 #3
0
 private void ContentEvents_MovingContent(object sender, ContentEventArgs e)
 {
     if (e.Content is SBRobotsTxt)
     {
         if (e.TargetLink.ID != ContentReference.WasteBasket.ID)
         {
             Task.Run(async() => await SeoHelper.AddRoute());
         }
         else
         {
             Task.Run(async() => await SeoHelper.RemoveRoute());
         }
     }
 }