2

Is it possible to get different results from template builder vs while publishing?

In our scenario: There is one dynamic component which contains embedded component with field that has category values, it works fine and field is available in xml generated from DD4T if we run using template builder however when we publish the same dynamic component with component template then the field with category value is not available in the output.

Can you please suggest the reason for this behavior?

5 Answers 5

6

There are different render modes, depending on what is happening, here is a short overview:

Template Builder

RenderMode is RenderMode.PreviewDynamic, Publication Target is null

CME Preview

RenderMode is RenderMode.PreviewDynamic, Publication Target ID is tcm:0-0-0 (or TcmUri.UriNull)

Session Preview

RenderMode is RenderMode.PreviewDynamic, Publication Target is Staging (the one where Session Preview is enabled)

Publish

RenderMode is RenderMode.Publish, Publication Target is the one selected in the Publish dialog

These are the main differences you will find in rendering, and the default TBBs for example act differently based on the RenderMode (and value of the Publication Target ID), which all accounts for the different outcomes you see.

2
3

Yeah, output could be different

  1. If the template renders the output according to the RenderMode.
  2. The resolved links could be different, as in template builder links would be preview links.

Also, in template builder it’s a common mistake to run the template against the shared item from wrong publication. It needs to be picked carefully specially if some publication specific data is used in templating.

3

You might also want to check that both the Component and Component Template that you are rendering with Template Builder are actually saved and checked-in.

I had a similar issue a while ago - the published content comes from the last checked-in version, whilst the previewed content was coming from the current (saved but not checked-in) version.

4
  • I already checked it and component, component template were checked-in while I published.
    – Hiren Kaku
    Jan 22, 2015 at 20:25
  • Presumably they were checked-in whilst you were viewing in Template Builder too? Jan 22, 2015 at 20:27
  • Yes, I closed template builder and manually did check-in avoid this issue.
    – Hiren Kaku
    Jan 22, 2015 at 20:27
  • good answer, even if it is not relevant in this case, it is certainly another option which could have influence. Jan 22, 2015 at 20:29
0

Found one solution for the problem and the solution was stranger than what I thought what it could be.

Scenario: In embeddable schema there are 6 fields out of which first 3 fields are populated in the component, next 2 fields are empty and last field is category field which was populated.

In this scenario it doesn't render last field which is category field. If I populate the 2 empty fields in the middle then category field is visible in the output xml for publishing.

To find out the issue, setup remote debugging and on debugging found out that while debugging template builder I was getting all 4 fields which were populated however in case of publishing only 3 fields were visible and category field was missing.

Still I am not sure how does it work in template builder without populating those fields.

0

TemplateBuilder uses a different rendering engine (DebugTemplatingRenderer instead of TemplatingRenderer) but i've never seen that result in the difference you are describing (if that is the case here I would consider that a serious product bug).

Could you give us the XML contents of the Component package variable in both template builder and publishing? The only explanation I can think of is that the two are not using the same component (due to either blueprinting or workflow)...

2
  • To answer few of the question that you have raised: 1. No workflow being used. 2. Verified that same component is being used from template builder vs publishing. 3. While performing more debugging found out that it is happening only for one particular component and not for any other component created from same schema.
    – Hiren Kaku
    Feb 3, 2015 at 18:08
  • 1
    Could you resync the component against the schema? Or even better; recreate the component from scratch with the same field data? I know bad things can happen when field orders in the schema are changed... Feb 5, 2015 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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