gpt4 book ai didi

tridion - 如何在Tridion DWT模板中迭代这些嵌入的值

转载 作者:行者123 更新时间:2023-12-02 03:59:22 26 4
gpt4 key购买 nike

我的XML是这样的。

.
.
.
</body>

<List>
<topicTitle>This is topic title</topicTitle>
<topDef>This is topic definition.</topDef>
</List>

我基本上想将 topicTitletopDef插入 <li>标签中。我正在尝试使用以下代码(仅出于简单起见显示topicTitle的代码):

<!-- TemplateBeginRepeat name="List" -->

<!-- TemplateBeginRepeat name="Field.topicTitle" -->

<li>@@RenderComponentField(FieldPath+".value",
TemplateRepeatIndex)@@ </li>
<!-- TemplateEndRepeat -->

<!-- TemplateEndRepeat -->

但这似乎不起作用。有任何想法吗?

最佳答案

如果是可嵌入模式,则不需要像Component链接那样遍历xmlList(使用TemplateBeginRepeat),在这里您可以通过语法直接访问嵌入式子元素:

@@ Component.XMLNameOfEmbeddedschema.XmlElementNameinEmbeddedSchema @@

请注意上面的XMLNameOfEmbeddedschema =您在插入可嵌入架构时在父架构中提供的XMLName。

因此,在您的情况下,它将与

@@ Component.List.topicTitle @@用于访问topicTitle的值。

如果此解决方案适合您,请将此答案标记为已接受...

关于tridion - 如何在Tridion DWT模板中迭代这些嵌入的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11163158/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com