我是SDL Tridion的新手,只是在探索内容交付。我在我的页面模板的TBB中使用了以下代码
<% ComponentPresentationFactory factory = new ComponentPresentationFactory("tcm:0-6- 1");
ComponentPresentation ps = factory.GetComponentPresentationFactory("tcm:6-9841","tcm:6-9858-32");
if(ps!=null )
{
string output="";
output=ps.Content;
Literal1.Text=output;
}
%>
<asp:Literal id="Literal1"Text="" runat="server"<</asp:Literal>我已经发布了该组件,并使用了动态组件模板。但是没有内容反映在page.Did上我错过了什么吗?
发布于 2013-04-14 06:09:11
尝试从uri tcm:0-6-1中删除空格,您的代码应该为factory.GetComponentPresentation("tcm:6-9841","tcm:6-9858-32");
https://stackoverflow.com/questions/15992517
复制相似问题