4

In an upgrade project from a static templating site (filesystem based) to a DXA site, we need to migrate functionality to publish a PDF to a specific Structure Group.

If I use the approach in this article for publishing binary assets (PDFs) to a specific Structure Group using AddBinary then would the default DXA Templates know about my specific Structure Group publish path for the PDF? Or, would it default to /images?

Is there another way?

2 Answers 2

4

DXA by default uses "Publish binaries for component" TBB in order to publish binaries. This TBB is implemented in "DD4T.Templates.PublishBinariesComponent" class. You will need to customize it or completely replace it with your own implementation.

@Mihai already described how to customize DD4T Binary Publisher in his article Custom Binary Publisher and Custom Binary Publisher (part 2)

For custom implementation you can follow Nick's article. Concept is still the same.

4

It should work the same way with DXA and before without DXA. DXA templates are just regular templates with DXA TBBs in them for producing serialized output. But the Component Template portion of it is the same.

When you run the correct AddBinary function, I recall that the Tridion CM tracks the use of the binary for publishing/unpublishing purposes. So if other templates publish/unpublish the same binary, but this template still uses it, it will not remove the binary. I don't see how this core CM behavior would change with DXA.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.