1

The Content Delivery API documentation states that the getContent() method of the com.tridion.dynamiccontent.ComponentPresentationAssembler class returns an empty string after executing a JSP ComponentPresentation, i.e. "In the case of a JSP ComponentPresentation, the JSP ComponentPresentation is executed and "" is returned."

My question is: if a "" (empty string) is returned after the JSP ComponentPresentation is executed (assuming executed to evaluate things like dynamic component link tags, UGC tags and P&P tags), then how do I control the placement of the Component Presentation on my page?

2 Answers 2

3

Seems like a documentation bug to me. I just tried this on a JSP and got the expected results.

<%
ComponentPresentationAssembler cpa = new ComponentPresentationAssembler(28);
String content = cpa.getContent(2729,2747);
out.write("Output is: " + content);
%>

You may want to open a ticket for a documentation defect.

0
0

Two Options are there:

1) NOT Recommended: write your css classes and hard code such that they define the layout and placement of your CP on the page

2) Recommended: Follow below process:

  • Create a Placeholder Schema with no Field
  • Create as many placeholder component as sections you want to define (one column, two column, three column etc.), say - Container 1, Container 2, Container 3 etc.
  • In your page, put all these container components and put respective component presentations after that
  • Write a C# TBB and append it in your Page Template with the logic to identify components lying in Section 1 (all those components which you have added after Container 1 placeholder component), and similarly for Section 2 and Section 3.
  • With respective IDs, push them on the Stack
  • Now you know in your DWT, in which section which all Component Presentation you have to show, so write your DWT template in that way

Feel free for any clarification.

1
  • I fail to see how this is an answer to the question. Maybe you mixed up two questions?
    – Quirijn
    Commented Mar 22, 2013 at 10:43

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.