8

I'm trying to confirm a page publishing scenario.

Setup:

  • Article schema
  • Article Full component template (CT) with both set:
    • Published as a Dynamic Component
    • Allow on Page Using Dynamic Assembly
  • Article Summary CT with just:
    • Published as a Dynamic Component set

If I publish an Article component, both dynamic component presentation (DCP) variations publish:

  • Article Full
  • Article Summary

If I publish a page that has an Article component with one template (e.g. Article Full), the corresponding DCP (Article + Article Full) will also be published.

Question: should the Article Summary DCP also publish?

2 Answers 2

9

No. When publishing a page, no other items are are resolved. Component Presentations on the page are rendered, but only if the Page Template explicitly does this (so if your page contains DCPs, but your PT does not call RenderComponentPresentation or an equivalent function, the DCP will not be published).

It is only when publishing components that resolving gets interesting:

  1. A DCP is published for every CT which is linked to the component's schema
  2. All pages containing the component with a static CT, which have already been published are republished
  3. All components which link to the component you are publishing are published (and components that link to those, etc. etc.)

If you want to have the Article Summary published also, you could call RenderComponentPresentation(article,summaryCT) from within a TBB in the Article Full CT (or your PT). Be careful of unpublishing though - Editors might have the expectation that unpublishing the page would also unpublish the Article Full and/or Summary DCP - neither will be. This is why it is sometimes wise to stick to static CTs unless strictly necessary.

8
  • I vividly remember internalizing those three points the hard way: (1. seeing all DCP variations in the broker, 2. wondering why a non-published page wouldn't publish, and 3. link propogation fun). But interestingly I've missed the distinction for publishing pages (publishes the page and just the CPs on them). Commented Jun 27, 2013 at 21:57
  • I remember getting a nasty surprise from this. My page needed several different dynamic renderings of the same component. (The page rendered different views of itself depending on parameters). I only wanted the content managers to have to put the component on the page once. Ended up with an events system to fill the gap. Commented Jun 27, 2013 at 21:58
  • @DominicCronin, well now you know all you needed was a RenderComponentPresentation()! ;-) Or was that for a 5.2 customer? Commented Jun 27, 2013 at 22:56
  • 2
    I just realized my initial statement about Component Presentations on a page being resolved was a bit misleading - actually there is no resolving going on here, the PT is responsible for explicitly rendering the CPS - have updated the answer.
    – Will Price
    Commented Jun 28, 2013 at 7:22
  • I think I'd made the same error with my answer below. I too have updated mine. Commented Jun 28, 2013 at 8:31
3

This is covered in the Publishing items section of the online documentation (login required).

Rather interesting is that the online documentation says the following of publishing Components:

If a Component is based on an allowed Schema that is used in a dynamic Component Template, only the dynamic Component Presentation is published.

From memory, and inline with what Will says above, I do not think that this is correct. It is not only the DCP(s) that will be published, but also published Components that link to it too.

2
  • That's definitely my favorite reference on what gets (re)published. I understand pages that have the component embedded (statically) are also (re)published. But I don't think pages that have the component embedded dynamically are published. [Shameless plug]We have three scenarios for CPs on pages[/shameless plug]. Commented Jun 27, 2013 at 23:00
  • Thanks Alvin. I have updated my answer slightly to clarify. Commented Jun 28, 2013 at 8:25

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.