I'm trying to control in which Publications an item is published when I publish in all child Publications.
What I developed is:
EventSystem.Subscribe<RepositoryLocalObject, PublishEventArgs>(PublshingWithChilds, EventPhases.Initiated);
private void PublshingWithChilds(RepositoryLocalObject item, PublishEventArgs args, EventPhases phase)
{
if (args.PublishInstruction.ResolveInstruction.IncludeChildPublications)
{
....
}
}
This works fine when I send only one Component or Page to publish.
But if I try to publish a list of Pages or Components from the CME and I select "publish with childs", the first item has:
args.PublishInstruction.ResolveInstruction.IncludeChildPublications = true
.
But all the other items that I sent to publish have:
args.PublishInstruction.ResolveInstruction.IncludeChildPublications = false
Is there another variable that contains that I selected "publish in child publications"?
Could I share the value of the first item with the others?