In my opinion, the best answer to your question is the introduction of a custom Resolver, which will include the required dynamic presentation of components. I would be wary of doing something when you weren’t publishing, because sometimes you might want to save DCP after publishing this page (for the type of “breaking news” or any other dynamic queries), but the code example below would do it is easy for you to adapt if you need to unpublish all DCPs.
Warning: the code below is not tested for production.
using Tridion.ContentManager; using Tridion.ContentManager.CommunicationManagement; using Tridion.ContentManager.ContentManagement; using Tridion.ContentManager.Publishing; using Tridion.ContentManager.Publishing.Resolving; public class IncludeDynamicComponentPresentations : IResolver { public void Resolve( IdentifiableObject item, ResolveInstruction instruction, PublishContext context, Tridion.Collections.ISet<ResolvedItem> resolvedItems) { if (!(instruction.Purpose == ResolvePurpose.Publish || instruction.Purpose == ResolvePurpose.RePublish)) {
Now you need to add this to the GAC and change [Tridion] \ Config \ Tridion.ContentManager.Config so that this Resolver is called after each permission action (for resolution / mappings for each element type).
source share