How can I control which related components are published when a particular component is published?

I am using SDL Tridion 2011 SP1. I have components A, B, and C. Component C is associated with A and B.

If I publish C, both components A and B are published. But I want to publish only Component A.

Can someone explain how to exclude the publication of component B?

+5
source share
3 answers

What you are experiencing is the default Tridion behavior. This is by design to ensure that when content is changed in a component, the publication will update all instances of that content on the website.

Like other answers, you can change this behavior using Custom Resolver:

 using Tridion.ContentManager;
 using Tridion.ContentManager.CommunicationManagement;
 using Tridion.ContentManager.ContentManagement;
 using Tridion.ContentManager.Publishing;
 using Tridion.ContentManager.Publishing.Resolving;

public class UpdateResolvedItems : IResolver
{
      public void Resolve(
            IdentifiableObject item, 
            ResolveInstruction instruction,
            PublishContext context, 
            Tridion.Collections.ISet<ResolvedItem> resolvedItems)
      {
           foreach (ResolvedItem resolvedItem in resolvedItems)
           {
             // Check resolved items, and remove accordingly
           }
      }
}

resolItems. , , .

.

+10

API, IncludeComponentLinks ResolveInstruction false, , ,

+3
source

All Articles