Be careful here - you are seriously changing the default behaviour of Tridion - the ability to republish all pages where a component is used by publishing the component is very useful for editors who may not know where a component is used, but want to make sure that it is up to date all over their website. Why is it that you do not want the pages to be published?
If you do want to implement this, the following basic code example gives you a start point. You need to create a .NET assembly (signed with a strong name key) containing a Custom Resolver (implement the IResolver
interface) , put it in the GAC on all CM and Publisher servers, and update your /config/Tridion.ContentManager.config (make a backup first!) Look for the element in the element and update the entry for components as follows:
<add itemType="Tridion.ContentManager.ContentManagement.Component">
<resolvers>
<add type="Tridion.ContentManager.Publishing.Resolving.ComponentResolver" assembly="Tridion.ContentManager.Publishing, Version=6.1.0.0996, Culture=neutral, PublicKeyToken=360aac4d3354074b" />
<add type="Example.Resolving.ComponentResolver" assembly="Example.Resolving, Version=1.0.0.0, Culture=neutral, PublicKeyToken=239a69fd0ef6bf5d" />
</resolvers>
</add>
Here is the .NET code: basically it goes through the list of what the default resolver already resolved, and removes the pages. Note that this will happen system wide - you may want to restrict your 'special' behaviour to a particular publication, or even component schema.
using Tridion.ContentManager.Publishing.Resolving;
using Tridion.ContentManager;
using Tridion.ContentManager.Publishing;
using System.Collections.Generic;
using Tridion.ContentManager.ContentManagement;
using Tridion.ContentManager.CommunicationManagement;
namespace Example.Resolving
{
public class ComponentResolver : IResolver
{
public void Resolve(IdentifiableObject item, ResolveInstruction instruction, PublishContext context, Tridion.Collections.ISet<ResolvedItem> resolvedItems)
{
if (!(item is Component))
{
return;
}
else
{
List<ResolvedItem> tempItems = new List<ResolvedItem>();
foreach (ResolvedItem resolvedItem in resolvedItems)
{
if (!(resolvedItem.Item is Page))
{
tempItems.Add(resolvedItem);
}
}
resolvedItems.Clear();
foreach (ResolvedItem resolvedItem in tempItems)
{
resolvedItems.Add(resolvedItem);
}
}
}
}
}