我们正在使用中继器渲染块的块方法。在这些块中,我们再次使用中继器,因此我们在中继器中有中继器。在某些情况下,当更改中继器块的顺序时,这些块的数据会消失,从而导致两个块的数据为空或数据合并。例如:一个例子:
保存前的中继器数据为:
mains[2][text] = "De Subaru E-Boxer 2.5i, All-Wheel Drive, automaat, EyeSight. Vanaf"
mains[2][price] = "46.995,-"
mains[2][_group] = "disclaimer"
mains[3][c_title] = "Selecteer uw kleur"
mains[3][c_slides][0][s_title] = "Crystal Black Silica"
mains[3][c_slides][0][s_image] = "/forester/eboxer/black.jpg"
mains[3][c_slides][0][s_color] = "#100500"
mains[3][c_slides][1][s_title] = "Horizon Blue Pearl"
mains[3][c_slides][1][s_image] = "/forester/eboxer/blue.jpg"
mains[3][c_slides][1][s_color] = "#556b9f"
mains[3][_group] = "carousel"
交换 mains[2] 和 mains[3] 的顺序后,数据变为空组:
mains[2][_group] = "carousel"
mains[3][_group] = "disclaimer"
现在两个块的所有字段数据都是空的。当我们在中继器中使用中继器时,我们会在我们的站点中多次遇到这种行为。我们是唯一的,还是这是一个已知的错误?我们使用的是最新版本 458
使用的第一个中继器:
{repeater name="mains" groups="~/themes/outback-2019/meta/blocks.yaml" tab="Blocks"}
{variable name="_dummy" type="text"}{/variable}
{/repeater}
块 yaml 包含另一个中继器
carousel:
name: Carousel
description: Car carousel
icon: icon-picture-o
fields:
c_section:
label: Carousel
type: section
c_title:
label: Title
type: text
span: full
c_slides:
type: repeater
titleFrom: title_when_collapsed
form:
fields:
s_title:
label: Title
type: text
span: left
s_image:
label: Image
type: mediafinder
mode: image
s_color:
label: Image
type: colorpicker
availableColors: ["#ffffff","#c8d9e3","#728258","#556b9f","#bf9f87","#8b112","#24292a","#100500"]