bolt / bolt/docs

RFC fields inside a set inside a collection can't be named "name"

Open
#1,111 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
45
Forks
189
PR merge metrics
No merged PRs in 30d

Description

I believe this is related to: #1025

```
sidebar:
...
fields:
socialnetworks:
label: "Social Networks"
type: collection
fields:
socialnetwork: # <----------------- this is always the output of 'name'
type: set
label: Social Network
fields:
name: # <------------------ this can't be accessed, unless it's renamed to something else
label: Name
type: text
icon:
label: Icon
type: text
link:
label: Link
type: text
group: content
...
singleton: true
```

And you try to iterate the 'socialnetworks':
```
{% set content sn = 'contenttype' %}

{% for item in sn.socialnetworks %}
{{ item.name }}
{% endfo%}
```

you will always get "socialnetwork" output in each iteration, however if you rename the text field "name" to something different like "title" then you get the actual value of the text field.

I think this needs to be clarified still in the docs, or maybe make a note that "name" shouldn't be used inside collection fields...

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.