I have some doubts related to "Publish binaries in a package" default TBB referred in Default Finish Actions.

Created the Component Template and added default finish actions TBB in my CT.

CT Design contains below code:

<img src ="@Component.Id" alt="",title=""/>

After publishing the page image link resolved to below url:

<img src="/country/images/binarypoc.png" alt="" ,title="">

By default SDL Tridion appends the TCM URI to the filename to make it unique. But in this case image file name doesn't contains any tcm-id. Why is that?

1 Answer 1


It seems that you are using Razor Mediator for your templates. Razor Mediator have the capability to automatically add Binaries to to the Package

 <razor.mediator extractBinaries="true" adminUser="INSERT TRIDION USERNAME">

It seems that while Razor Mediator adds the Multimedia Components to the Package it populates the FileName property with the Multimedia Component File Name but it doesn't add a FileNameSuffix

Engine.AddBinary() is executed by the Publish Binaries In Package TBB. It will internally call to the Item.ConstructFileName() which will concatenate Item.Properties["FileName"] and Item.Properties["FileNameSuffix"]

If Item.Properties["FileNameSuffix"] is not populated then you will only get the File Name

If you want the TCMURI as a FileNameSuffix the you will need to add a new TBB that look for all the Multimedia Components in the Package and populates that property

  • 1
    There is an existing open source TBB which does this - check out the Force Unique Binary Filenames TBB in sdltridionworld.com/community/2011_extensions/…
    – Will Price
    Sep 25, 2014 at 12:10
  • yes...we are using Razor Mediator for our templates...also I agree with your answer.. Sep 25, 2014 at 12:21
  • I have one more question...in case of DWT Templates will it append tcm-id to the filename? Sep 25, 2014 at 12:38
  • 1
    The TBB mentioned by Will in his comment above will add the tcm-id to the filename of each image outputted by the DWT TBB. Sep 25, 2014 at 17:08

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.