I'm not entirely sure what's going on here, but I have a set inside a replicator field and when outputting the contents of that set onto my template, it seems extremely finicky. For example – this works:
{{ elseif type == "split_column" }}
{{ if split_layout_style == "Text Column First" }}
<div><div>{{ text_content|smartypants }}</div><div></div></div>
{{ endif }}
{{ if split_layout_style == "Text Column Last" }}
<div><div></div><div>{{ text_content|smartypants }}</div></div>
{{ endif }}
But this doesn't work:
{{ elseif type == "split_column" }}
{{ if split_layout_style == "Text Column First" }}
<div><div class>{{ text_content|smartypants }}</div><div></div></div>
{{ endif }}
{{ if split_layout_style == "Text Column Last" }}
<div><div></div><div>{{ text_content|smartypants }}</div></div>
{{ endif }}
The only change is that I added an empty class
attribute on one of the <div>
layers. As soon as I add that class, the entire replicator set is ignored, leaving my template page empty.
Here is the relevant field definition in my yaml file (I've only included the field set that I'm having issue with for brevity):
page_content: display: Content types type: replicator instructions: Select the types of content you want to display on this page
sets:
split_column:
display: Split Column
fields:
split_layout_style:
display: Layout Style
type: select
options:
- Text Column First
- Text Column Last
background_images:
display: Background Images
instructions: Add up to two background images which will be used (in-order) for the background of each column
type: file
allowed: [png, jpg]
destination: assets/img/
max_files: 2
text_content:
display: Text
instructions: The text to be placed in the text-column (first column or second column depending on the Layout Style selection)
type: redactor
image_dir: assets/img/