Skip to content

Commit d37e506

Browse files
authored
Unique fieldnames in collections
Suggesting to have unique fieldnames in collections in the examples in the docs, related to bolt/core#3386 There may be more instances in the docs where this can apply.
1 parent baf9070 commit d37e506

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

docs/fields/collection.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ along with the definition of the sub fields under the `fields` key.
1919
features:
2020
type: collection
2121
fields:
22-
title:
22+
featuretitle:
2323
type: text
24-
image:
24+
featureimage:
2525
type: image
2626
extensions: [ gif, jpg, png ]
27-
content:
27+
featurecontent:
2828
type: html
2929
```
3030
@@ -78,7 +78,7 @@ fields from the collection by name or by type. Because of the nature of a Collec
7878
In that light, it's usually good practice to always use a for loop to iterate over them. The examples below will grab the fields named `content` or all of the `type: text` fields. We do this with Twig's [`filter` filter][filter]
7979

8080
```twig
81-
{% for feature in record.features|filter(feature => feature.name == 'content') %}
81+
{% for feature in record.features|filter(feature => feature.name == 'featurecontent') %}
8282
{{ feature }}
8383
{% endfor %}
8484
@@ -114,12 +114,12 @@ The field has three specific options:
114114
limit: 3
115115
collapsible: false
116116
fields:
117-
title:
117+
featuretitle:
118118
type: text
119-
image:
119+
featureimage:
120120
type: image
121121
extensions: [ gif, jpg, png ]
122-
content:
122+
featurecontent:
123123
type: html
124124
```
125125

@@ -134,23 +134,23 @@ The field has three specific options:
134134
features:
135135
type: collection
136136
fields:
137-
title:
137+
featuretitle:
138138
type: text
139-
content:
139+
featurecontent:
140140
type: html
141-
image:
141+
featureimage:
142142
type: image
143143
default:
144144
0:
145-
field: title
145+
field: featuretitle
146146
default: "Lets start with a title"
147147
1:
148-
field: image
148+
field: featureimage
149149
default:
150150
filename: "kitten.jpg"
151151
alt: "Picture of a kitten"
152152
2:
153-
field: content
153+
field: featurecontent
154154
default: "<strong>Finish strong</strong> after the kitten with some content"
155155
```
156156

0 commit comments

Comments
 (0)