穿过多组分循环链接在支持SDL Tridion 2011获得在Dreamweaver TBB链接组件

2019-09-17 11:28发布

我工作在Dreamweaver模板积木和页面实现SiteEdit。

我使用支持SDL Tridion 2011 SP1和网站编辑2012和默认梦韦弗模板。

我的架构有型的多值字段“组件链接”。 我的主要成分XML看起来是这样的。

<Content xmlns="UUID">
    <link xlink:type="simple" xlink:href="tcm:202-8121"
          xmlns:xlink="http://www.w3.org/1999/xlink"></link>
    <link xlink:type="simple" xlink:href="tcm:202-8122"
          xmlns:xlink="http://www.w3.org/1999/xlink"></link>
</Content>

链接组件XML看起来是这样的。

<Content xmlns="Some other UUID">
    <text>Hi all</text>
</Content>

我的目标是获得链接的组件的架构的名称并启用内嵌编辑的链接部件的领域了。 我创建一个单独的组件模板用于与所述URI链接部件的架构tcm:202-8142-32

我已经写了DWT TBB像这样主要成分。

<!-- TemplateBeginRepeat name="Fields.link" -->
    <div>
        (FieldPath=@@FieldPath@@, TemplateRepeatIndex=@@TemplateRepeatIndex@@)
    </div>

    <!-- Not able to get the schema name of the linked component -->            
    @@RenderComponentPresentation(link, "tcm:202-8142-32")@@
<!-- TemplateEndRepeat -->

我是通过组件链接字段“链接”无法循环。

然后,我改变了只允许一个单一的组件链接的模式。 当TBB写有:东西很好地工作:

@@RenderComponentPresentation(link, "tcm:202-8142-32")@@

我知道问题出在穿过多组分链接循环。

请建议穿过多组分环节如何循环,并得到各连接组件的架构名称。

Answer 1:

当你遍历多值字段的值(如你在这里做),电流值在一个名为变量可用Field 。 所以,如果你只需要改变您的来电RenderComponentPresentation指的是,我认为它应该工作:

<!-- TemplateBeginRepeat name="Fields.link" -->
    <!-- Not able to get the schema name of the linked component -->            
    @@RenderComponentPresentation(Field, "tcm:202-8142-32")@@
<!-- TemplateEndRepeat -->


Answer 2:

我不认为这是可能的,你得到使用DWT架构名称。 什么你需要做的是写一个C#构造块,提取你正在寻找的值,然后把这个值转换为包您满意。



文章来源: Looping through the multiple component links to get the schema name of the linked component in Dreamweaver TBB in SDL Tridion 2011