The binaries get published with TCM ID appended to their file name. I want to change the file name to be published without a TCM ID and path based on Structure Group.
The latest DD4T version has BinaryPathProvider
which can be extended, but I am using an older version of DD4T (2.0.8) from DXA 1.6.
I have implemented a custom BinaryPublisher
. How will this class be referred in DynamicComponentPresentation
TBB which publishes the binary files?
1 - Implemented a custom Build Manager and in constructor we our referencing the custom Binary Publisher.
public CustomBuildManager(Package package, Engine engine) : base(package, engine)
{
this.BuildProperties = new BuildProperties(package);
this.BinaryPublisher = new CustomBinaryPublisher(package, engine);
}
2 - Created a custom Dynamic Component Presentation TBB which extends the BaseComponentTemplate class. In Transform
method created a new instance of CustomBuildManager
class.
public override void Transform(Engine engine, Package package)
{
CustomBuildManager manager = new CustomBuildManager(package, engine);
manager.SerializerService = this.Manager.SerializerService;
this.Manager = manager;
base.Transform(engine, package);
}
But this customManager still references base Binary Publisher instead of custom class.
The only nuget package available is DD4T.Templates.Base which has base classes available. What package should I use for extending DynamicComponentPresentation class?