XML cache has not been updated on Document.AfterPublish
Hi guys,
I'm wrestling the Umbraco event API and I'm stuck. I need to traverse the document xml when a node is published. I am using content.Instance.XmlContent, and try to get the resently published document like this:
This works great on nodes that have allready been published. New nodes on the other hand does not exist in the XmlContent yet, allthough the event is called AFTER publish.
I need to use xpath to find what I need in the XmlDocument, after finding the resently published node.
Any ideas on how to do this on both new and old nodes?
It's because at that point the document is only *prepared* for publishing. It's when you call umbraco.library.UpdateDocumentCache() that the XML is being populated. So you probably want to listen to the umbraco.content.BeforeUpdateDocumentCache event...
XML cache has not been updated on Document.AfterPublish
Hi guys,
I'm wrestling the Umbraco event API and I'm stuck. I need to traverse the document xml when a node is published. I am using content.Instance.XmlContent, and try to get the resently published document like this:
This works great on nodes that have allready been published. New nodes on the other hand does not exist in the XmlContent yet, allthough the event is called AFTER publish.
I need to use xpath to find what I need in the XmlDocument, after finding the resently published node.
Any ideas on how to do this on both new and old nodes?
/Rune
It's because at that point the document is only *prepared* for publishing. It's when you call umbraco.library.UpdateDocumentCache() that the XML is being populated. So you probably want to listen to the umbraco.content.BeforeUpdateDocumentCache event...
Thx.
Will try that.
/Rune
Works like a charm. Thanks again Niels.
/Rune
is working on a reply...