Publish later

Topics: Customizing Orchard
Nov 30, 2011 at 12:11 PM

Hi,

Here is my createPost code. I want check if customer click publish later button or not. How can i check it. If customer click publish later i want do  

  _contentManager.Unpublish(Articles.ContentItem);

 _contentManager.Create(Articles, VersionOptions.Published);
            dynamic model = _contentManager.UpdateEditor(Articles, this);

            if (!ModelState.IsValid)
            {
                _transactionManager.Cancel();
                // Casting to avoid invalid (under medium trust) reflection over the protected View method and force a static invocation.
               // return View((object)model);
                return View ();
            }

            _contentManager.Publish(Articles.ContentItem);

           // _categoryPathConstraint.AddPath(Articles.As<IRoutableAspect>().Path);

            return Redirect("~/Admin/eProp.Articles");

Coordinator
Dec 1, 2011 at 5:16 AM

Why?

Developer
Dec 1, 2011 at 10:16 AM

Some handler event is fired (just look at all the On* methods in a handler that you can call with a lambda expression) for sure when the user saves, look at them. There you could also check the publish date of the item.