Tridion 组件内部组件模板中的访问字段
我这里有个问题。我目前的结构是:Tridion 组件内部组件模板中的访问字段,tridion,tridion-2011,Tridion,Tridion 2011,我这里有个问题。我目前的结构是: ComponentA FieldA1 - textField CombonentsB - componentLink (multi-value) FieldB1 - textField ComponentC - componentLink FieldC1 - textField 现在,我尝试将带有模板的ComponentA放在页面上。 我正在使用DWT模板。 我需要的是访问模板中的字段C1 我已经在
ComponentA
FieldA1 - textField
CombonentsB - componentLink (multi-value)
FieldB1 - textField
ComponentC - componentLink
FieldC1 - textField
现在,我尝试将带有模板的ComponentA放在页面上。
我正在使用DWT模板。
我需要的是访问模板中的字段C1
我已经在TemplateA中添加了“将链接组件添加到包”TBB。
我认为这和这个是一样的:
我可以访问模板中的字段B1,但不能访问层次结构中较低的字段
我是否必须编写另一个包含整个层次结构的TBB,还是应该按照预期工作,而我的访问代码就是错误的
<!-- TemplateBeginRepeat name="ComponentsB" -->
@@ComponentC.Fields.FieldC1@@
<!-- TemplateEndRepeat -->
@@组件C.Fields.FieldC1@@
我能做些什么使它工作?写一个新的TBB还有其他解决方案吗
==========解决方案============
在Nickoli Roussakov告诉我DGX之后,我成功地实现了它。
代码如下:
<!-- TemplateBeginRepeat name="ComponentsB" -->
@@Get("ComponentsB[${TemplateRepeatIndex}].Fields.ComponentC.Fields.FieldC1")@@
<!-- TemplateEndRepeat -->
@@获取(“ComponentsB[${TemplateRepeatIndex}].Fields.ComponentC.Fields.FieldC1”)@@
GetLinkedComponents仅在组件嵌套的第一级工作,因为使用DWT语法无法进行更深层次的操作。您可以选择编写一个自定义tbb,从componentB中呈现所需的输出,或者尝试Nuno的DGX扩展(也在sdltridionworld上)而不是GetLinkedComponents。thx很多时候,我用DGX实现了这一需求!