It works like a charm when i press the "save & publish" button in umbraco.
However, I would like this code to be executed when I use the PublishAt feature. But when the date/time comes the document/node is published but this event does not fire.
What to do ?
Is there a AfterPublishAt event ? if so I havent found it. :(
PublishAt - Document.AfterPublish not firing?
Hi
I need a little help.
I have an eventhandler in which I have the Document.AfterPublish event.
It looks like this:
void Document_AfterPublish(Document sender, umbraco.cms.businesslogic.PublishEventArgs e)
{
if (sender.ContentType.Alias == "this" || sender.ContentType.Alias == "this1" || sender.ContentType.Alias == "that")
{
foreach (Document d in sender.Children)
{
if (d.ContentType.Alias == "that" && d.Published)
{
d.Publish(sender.User);
umbraco.library.UpdateDocumentCache(d.Id);
}
}
umbraco.library.UpdateDocumentCache(sender.Id);
RemoveEventsXml();
}
}
private void RemoveEventsXml()
{
System.Web.HttpContext.Current.Cache.Remove("this.ex");
System.Web.HttpContext.Current.Cache.Remove("this.ex.1");
System.Web.HttpContext.Current.Cache.Remove("this.ex.2");
}
It works like a charm when i press the "save & publish" button in umbraco.
However, I would like this code to be executed when I use the PublishAt feature. But when the date/time comes the document/node is published but this event does not fire.
What to do ?
Is there a AfterPublishAt event ? if so I havent found it. :(
is working on a reply...