0

In DXA 2.2, the binary filename contains a TcmID at end, example:

/media/image_tcm12-3456.png

Can we remove the TcmID part from image url?

2
  • A lot depends on why you want to do it. For example, if you just want to cloak the fact you are using Tridion, changing from _tcm12-3456.png to _3456.png will be much less painful than removing the id entirely.
    – Dominic Cronin
    Aug 18 '20 at 16:06
  • This old blog post isn't about DXA, but has some useful background blog.indivirtual.nl/publishing-binary-assets-sdl-tridion
    – Dominic Cronin
    Aug 18 '20 at 16:18
2

Agree with @Dominic.

Technically It's possible to customize to Strip TCM URI from binary filename.

If you do this, there is a chance of conflicts because the file name is no longer guaranteed to be unique. Use with care.

If you really want to then maybe you need to customize the DXA TBBs ModelBuilder pipeline to handle all the images filename with AddBinary method to pass the filename without Tcm id.

I hope it helps

4
  • thanks Velmurugan and Dominic, we know tcmid in filename to avoid conflicts, but we need to keep the original filename. we try to avoid filename conflict in different way. any quick config to remove the tcmid in filename, will be much appreciated thanks experts.
    – Lucas Liu
    Aug 18 '20 at 16:48
  • AFAIK - there is no config to change in OOTB it needs TBB customization
    – Velmurugan
    Aug 19 '20 at 7:20
  • starting with version 2.2.2, the DD4T templates - It's customized and configurable maybe worth refer to the TBB code Quirijn posted a nice blog, blog.trivident.com/customizing-binary-paths-in-dd4t
    – Velmurugan
    Aug 19 '20 at 13:46
  • Super! thanks Velmurugan
    – Lucas Liu
    Aug 19 '20 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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