4

In our project (Web 8.5) we use (Tridion.ContentManager.Templating.Engine.PublishingContext.RenderedItem) AddBinary to publish multimedia components when they are not yet published. If such components are published through this AddBinary method, then the corresponding files are deployed at the file server, but the published state is not updated in the CMS. So, as a result, components that are not yet published themselves via the CMS, but published via AddBinary, will not have their published state set to true.

I would expect the published state to be updated when using AddBinary though.

Is this normal behaviour or do I need to change something?

2 Answers 2

5

Why would you expect it?

Add binary method just adds binary to the package. Publish state is changed when item is published to delivery as a separate item and is present in broker db as Component Presentation.

AddBinary will not do that.

6
  • Hi Marko, thank you for your reply! Okay, good to know that AddBinary does not do that.. What then is the best method to place binaries on the file server , while also changing publish state? Is is e.g. best to use PublishEngine.Publish in this case? Thanks again for your help.
    – Jefta
    Commented Jul 6, 2021 at 11:24
  • Why do you want a state set to published. In broker each CP has a reference to image. It is in binary reference table or something like that. So if 5 CPs use same image, when all 5 are unpublished, tridion will remove binary from file system.
    – Marko Milic
    Commented Jul 6, 2021 at 13:09
  • Ah yes, So, problem is that some pages have a lot of binaries. When such a page is published, in some cases the package gets enormous and results in a failed publication as the processes can't handle it. What I'm trying is to only add binaries to a package when they're not published yet, or when the publish date is earlier than the revision date, so that the package size is smaller as only binaries are added that should be published. So when a page publish does result in publishing binaries, I want them to be flagged as published, so they will not be published again untill only necessary.
    – Jefta
    Commented Jul 6, 2021 at 13:32
  • yeah... dont do that. what you are trying to do is hack default tridion behavior. it can get you later on. Just increase default tridion package size. You can specify it in megabytes, so it wont fail. you will be able to send then gigabytes. And think of removing some of the images from page. Maybe your model can be more optimized.
    – Marko Milic
    Commented Jul 6, 2021 at 20:25
  • Other option is to think on introducing ECL. You can store images in DAM, and just reference them in tridion. This way you will not have a problem with then being copied to broker.
    – Marko Milic
    Commented Jul 6, 2021 at 20:26
1

As Marko discussed, this is normal behaviour. I do recall an old article from way back by Frank van Puffelen that discussed this and a Binary Event Tracker to allow these "implicitly published binaries" to show up as published/unpublished.

Its quite old so had to to dig it out via the Wayback Machine! https://web.archive.org/web/20170524083931/https://sdltridionworld.com/community/2011_extensions/binaryeventtracker.aspx

The Binary Event Tracker is also still available on AppStore: https://appstore.sdl.com/web-content-management/app/binary-event-tracker/645/

It goes without saying, your mileage may vary!

1
  • Hi Neil, thank you for your suggestion and for the detailed article and plugin! We'll discuss it with our team, it looks quite promising though, even though it is written for 2011. Thanks!
    – Jefta
    Commented Jul 8, 2021 at 7:34

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.