I'm creating a Saving Content event that fires when I save a documentType with a multinode treepicker. I want to be able to cancel the save and/or publish if the item selected with the picker has the same id as XXXX.
The thing is when I try to loop the multinode treepicker it's empty.
here is my code:
foreach (var item in schedule.Items)
{
foreach (var currentItem in ((Umbraco.Web.PublishedContentModels.Schedule)page).Items)
{
if (item.Id == currentItem.Id)
exist = true;
}
}
This double foreach is in a function where I pass the 'page' from
foreach(var page in e.SavedEntities). I also used IPublishedContent iPublishedPage = umbracoHelper.Content(page.Id); to change get 'page' as an IPublishedContent (castable to my the model.generated of my documentype) instead of an IContent
Event Saved. How to get value being saved
I'm creating a Saving Content event that fires when I save a documentType with a multinode treepicker. I want to be able to cancel the save and/or publish if the item selected with the picker has the same id as XXXX. The thing is when I try to loop the multinode treepicker it's empty.
here is my code:
This double foreach is in a function where I pass the 'page' from
foreach(var page in e.SavedEntities). I also used IPublishedContent iPublishedPage = umbracoHelper.Content(page.Id); to change get 'page' as an IPublishedContent (castable to my the model.generated of my documentype) instead of an IContent
is working on a reply...