In a custom resolver, I wish to modify the resolving behaviour only if the item is being published from a parent publication. IResolver.Resolve() has various parameters which may be useful (but maybe not).
The item parameter gives me the ID of the page (in this case) being published. I have two publications: a parent and a child, so when I publish from the parent with "Also Publish/Unpublish in child publications" selected, I see Resolve() being invoked twice, once for the parent and once for the child. (OK - actually it's 4 times, as I have two publication targets, but for the sake of argument, let's say 2.) I can see the page URI in the parent context, and then on the second invokation, in the child context.
I had hoped the resolve instruction parameter would be useful, but instruction.IncludeChildPublications appears always to be false. (Is this, perhaps, a side-effect of the default resolver being called first?)
I had also hoped the PublishContext would be useful, but context.Publication gives back the same publication as the item is in.
How can I accurately determine that the publish is being invoked via "Also Publish/Unpublish in child publications? Is it possible in a custom resolver? Are there other techniques I could use, such as the events system, or could I even pass data from one to the other?
IResolver.Resolve()
parameters, but Bart Koopman describes a way to always change a specific parent publication's items in a comment to my post.