gpt4 book ai didi

kentico - 如何在 Kentico 中嵌套多个 CMSRepeater?

转载 作者:行者123 更新时间:2023-12-03 03:27:35 24 4
gpt4 key购买 nike

使用 Kentico CMS 框架(版本 7)如何嵌套多个 CMS Repeater?

我已经尝试了以下绑定(bind)父级的方法,但是如何让子级绑定(bind)?

<cms:CMSRepeater ID="repProducts" runat="server" ClassNames="cms.product" OrderBy="NodeLevel,NodeOrder" SelectOnlyPublished="true"  MaxRelativeLevel="1">
<ItemTemplate>
<%# Eval("DocumentName")%>
<ul>
<li>
<cms:CMSRepeater ID="repProductsNested" runat="server" ClassNames="cms.product" OrderBy="NodeLevel,NodeOrder" SelectOnlyPublished="true" MaxRelativeLevel="1" Path="./%">
<HeaderTemplate>
<ul>
</HeaderTemplate>
<ItemTemplate>
<li><%# Eval("DocumentName")%>
</ItemTemplate>
</cms:CMSRepeater>
<FooterTemplate>
</ul>
</FooterTemplate>
</li>
</ul>
</ItemTemplate>
</cms:CMSRepeater>

最佳答案

我认为您的第一个中继器上缺少两个重要属性,即 DelayedLoading="true"NestedControlsID="repProductsNested" 因此您的代码应如下所示:

<cms:CMSRepeater ID="repProducts" runat="server" ClassNames="cms.product" OrderBy="NodeLevel,NodeOrder" SelectOnlyPublished="true"  MaxRelativeLevel="1" NestedControlsID="repProductsNested" DelayedLoading="true">
<ItemTemplate>
<%# Eval("DocumentName")%>
<ul>
<li>
<cms:CMSRepeater ID="repProductsNested" runat="server" ClassNames="cms.product" OrderBy="NodeLevel,NodeOrder" SelectOnlyPublished="true" MaxRelativeLevel="1" Path="./%">
<HeaderTemplate>
<ul>
</HeaderTemplate>
<ItemTemplate>
<li><%# Eval("DocumentName")%>
</ItemTemplate>
</cms:CMSRepeater>
<FooterTemplate>
</ul>
</FooterTemplate>
</li>
</ul>
</ItemTemplate>
</cms:CMSRepeater>

关于kentico - 如何在 Kentico 中嵌套多个 CMSRepeater?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16860362/

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