【发布时间】:2012-11-01 13:38:15
【问题描述】:
我这里有个问题。我目前的结构是:
ComponentA
FieldA1 - textField
CombonentsB - componentLink (multi-value)
FieldB1 - textField
ComponentC - componentLink
FieldC1 - textField
现在我正在尝试将带有模板的 ComponentA 放置在页面上。 我正在使用 DWT 模板。 我需要的是访问模板中的 FieldC1。
我已经在 TemplateA 中添加了“将链接组件添加到包”TBB。 我认为它与这个相同: http://sdltridionworld.com/community/extension_overview/addcompstopackage.aspx 我可以访问模板中的 FieldB1,但不能访问层次结构中更靠下的字段。
我是否必须编写另一个包含整个层次结构的 TBB,还是应该按预期工作而我的访问代码是错误的?
<!-- TemplateBeginRepeat name="ComponentsB" -->
@@ComponentC.Fields.FieldC1@@
<!-- TemplateEndRepeat -->
我该怎么做才能让它发挥作用?除了编写新的 TBB 之外,还有其他解决方案吗?
=========== 解决方案============
在 Nickoli Roussakov 告诉我有关 DGX 的信息后,我设法正确实施了它。 代码如下:
<!-- TemplateBeginRepeat name="ComponentsB" -->
@@Get("ComponentsB[${TemplateRepeatIndex}].Fields.ComponentC.Fields.FieldC1")@@
<!-- TemplateEndRepeat -->
【问题讨论】:
标签: tridion tridion-2011