5

I understand that SDL Tridion will republish items that use an item you're publishing, which we might call "link propagation." We can change this behavior using Custom Resolvers or previously with the Event System.

AddBinary()

We can publish a multimedia component directly if it has a template associated with its schema. But we can also use AddBinary() to "implicitly" publish multimedia. Frank van Puffelen explains this isn't really publishing in the strict sense in the Binary Event Tracker post. When such a binary is no longer referenced in Content Delivery, it's removed.

RenderComponentPresentation()

Is this the same behavior, or even terminology, for RenderComponentPresentation()?

The docs explain (requires login):

If Pages include dynamic Component Presentations, dynamic Component Presentations are published. Pages on which the dynamic Component Presentation is used include a line of code that is be executed by the Content Distributor.

I'm guessing that "line of code" is RenderComponentPresentation() or an equivalent?

Do multimedia added with AddBinary or component Presentations with RenderComponentPresentations act the same in delivery? In other words, is the later also an implicit publish and are DCPs removed when no longer needed in delivery?

Background: I've seen questions related to link propagation (1, 2, 3, 4), but sometimes with phrases like "related items." I'm seeing the difference between the default resolving behavior, template logic that "publishes," but am not completely clear on delivery (yet). :-)

Update: On SDL Tridion 2011 SP1-1, I see:

  • Queuing a page with an embedded component presentation where the component template is set to dynamic will also queue the DCP (visible in items to publish).
  • A page with @@RenderComponentPresentation()@@ but no components won't show the referenced component in items to publish, but this DCP will show up in the broker database after a successful publish.
3

Not completely, when you Publish a Page and that Page contains Dynamic Component Presentations, they will be Published along with the Page. This is initially determined by the Resolver, which looks at the Component Presentations on the Page. At that point the Template code is not even looked at.

So from that point of view, the RenderComponentPresentation() call has no influence. But now, take a look at for instance when you call RenderComponentPresentation("tcm:1-2", "tcm:1-4-32") and the Component tcm:1-2 is not part of the Component Presentations on the Page (and is a Dynamic Component Presentation), then that Component Presentation isn't part of the resolve action, but it will be Published.

What the call RenderComponentPresentation() initially does, is write out the results of rendering the Component Template. If that Component Template happens to be a Dynamic one, a TCDL tag will be written out (which the Deployer converts into a control (ASP.NET or JSP, depending on Target Language), and that DCP is also added to the rendered items and thus it will be Published to the Broker.

So to conclude, the Resolver initially Publishes Dynamic Component Presentations if they are on the Page, but the call RenderComponentPresentation() will also do that for DCPs which are not on your Page.

  • I see your first part--queuing a page with DCPs in it will show the DCPs in the Items to Publish list (with no rendering done yet, right?). But I seem to be able to actually "publish" a DCP not referenced on another page with no components and RenderComponentPresentation() in its DWT TBB. It ends up in storage (broker database), though Show Items to Publish won't show it when queued for publishing. Will Price describes this "RenderCP = publish" behavior in this answer, but maybe there's a difference with in-page DCPs and the API call? – Alvin Reyes Sep 11 '13 at 16:53
  • I've tested it out with a footer DCP which I have a RenderComponentPresentation() call for in the Page Template, but it's not actually on the Page. As expected when viewing the items to publish, (result of the resolve action) it is not listed in there. But what I didn't expect was that after publishing that Page, my DCP was indeed published, so I adjusted my answer. And indeed as Will answered, when you unpublish the Page, the Template code is not executed, so that DCP will NOT be unpublished. – Bart Koopman Sep 12 '13 at 8:12

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.