i'm programming a backend extension where you can create facebook objects (news post, events) directly from an umbraco document (eg news, events). for that i hook on the beforepublish event to get and post the values to facebook. works fine.
from the facebook api i get back the objectid which i have to save in the umbraco document for further handling (deleting, updating object values in the future). for now it works but the document is marked unpublish as there is a new value (the object id) that didn't exist at the moment i saved/published the page.
i could use the beforesave event to get the facebook object id, but i'm not sure how to check if the umbraco document only got saved or saved&published in the backend.
so whats the best way to achieve that my extension only connects to facebook when the documents gets published and that i can update a value in the document without marking the document unpublished?
Question about BeforePublish & BeforeSave API
Hi,
i'm programming a backend extension where you can create facebook objects (news post, events) directly from an umbraco document (eg news, events). for that i hook on the beforepublish event to get and post the values to facebook. works fine.
from the facebook api i get back the objectid which i have to save in the umbraco document for further handling (deleting, updating object values in the future). for now it works but the document is marked unpublish as there is a new value (the object id) that didn't exist at the moment i saved/published the page.
i could use the beforesave event to get the facebook object id, but i'm not sure how to check if the umbraco document only got saved or saved&published in the backend.
so whats the best way to achieve that my extension only connects to facebook when the documents gets published and that i can update a value in the document without marking the document unpublished?
hope my explaination makes sense ;-)
thx in advance,
andi
Umbraco 6.0.0.
is working on a reply...