There are many ways to add a dynamic presentation to a page.
Direct approach. For this, the presentation of your component must be allowed on the page. Select the Allow per page using dynamic assembly check box. Add a presentation to the page just like everyone else.
Code approach. You can use the API to get the component view directly from the broker's repository. Here is a sample code for it.
*<%@ Import Namespace="Tridion.ContentDelivery.DynamicContent"%> <% ComponentPresentationFactory factory = new ComponentPresentationFactory(); ComponentPresentation ps = factory.getComponentPresentation("CompID","TEMPLATEID"); Response.Write(ps.Content); %> JSP example: <%@ page import="com.tridion.dynamiccontent" %> <% ComponentPresentationFactory cpf = new ComponentPresentationFactory("tcm:0-1-1");
WITH#
ComponentPresentationFactory cp_factory = new ComponentPresentationFactory(publicationid); ComponentPresentation cp = cp_factory.GetComponentPresentation(CompID, TEMPLATEID); if (cp != null) { Output = cp.Content; }
source share