7

I have a page template containing two TBBs. The first renders the component presentations, and the second is the default finish actions. The page contains a component presentation that writes an XML document to Output.

The output is intended to be the xml document, however instead of the bare document, it is wrapped in a <tcdl:ComponentPresentation/> element. In the template builder I can see that after executing the first TBB, the Output has this spurious elemnent, but once I step through the Default Finish Actions, I can see it getting cleaned up by the Cleanup Template TBB.

By the time I return to my page template scope and view the Output in the result step, the clean output is still to be seen. When I publish the page, however, the tcdl wrapper is present in the output.

When I preview the page, the output is as desired. Is there an expected difference in the way the clean-up works in preview and publish mode? For example, does the behaviour depend on the configuration of the publication target?

EDIT: I've just followed up on that suspicion, and it turns out that setting the target language to None (instead of ASP.NET) gets me the desired output. But why?

  • I thought the behavior of the cleanup template depends on the type of component presentation (dynamic or not etc.) since for a DCP, it should leave the TCDL for the Deployer to replace. – Bart Koopman Apr 17 '13 at 16:53
  • Should it have been removed by a TCDL transformer? I don't see any <tcdl:ComponentPresentation/> in my (xml) pages... – Nuno Linhares Apr 17 '13 at 20:24
  • Nuno - the issue came up when trying to set up a TCDL transformer for some other stuff. The question still remains as to why the cleanup doesn't work. – Dominic Cronin Apr 17 '13 at 20:51
  • 1
    Environment related. It works for me, it might be removed at deployment time (Tridion may have a reason to add those tags that is important to the delivery tier). – Nuno Linhares Apr 18 '13 at 8:16
12

The Cleanup Template default TBB is responsible for removing certain <TCDL> tags, but its behaviour does indeed depend on whether you are in preview mode or not and also what target language is specified for the Publication Target.

If the target language is "None", then the TBB cleans up both <TCDL:ComponentField> and <TCDL:ComponentPresentation> tags. If another target language has been specified, then it only cleans up <TCDL:ComponentField> tags as the <TCDL:ComponentPresentation> tags are considered to be the responsibility of the deployer (or REL maybe).

When in preview mode (i.e. in Template Builder) the target language is assumed to be "None", so both tags are cleaned up.

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.