Hi guys. This is my first post here so please don’t judge me.
The problem which I’m struggling to resolve is that I need to have a list of fields to be as subitem of current set of fields. The textarea does not fit, because I need these items to be as li’s on a view. So it should be like this: Blocks
You see a set of blocks and the list should be in every of them. The one on a screenshot was achieved in this way:
fields:
*here's other text fields*
.columns-details:
type: list
label: Columns details
But when I press ‘Add item’ it shows me two fields and they are inactive: Nested list
I know that I did not configure any of fields inside. But if I do:
fields:
*here's other text fields*
.columns-details:
type: list
label: Columns details
fields:
.text:
type: text
label: text
the page in admin panel just disappear, which I consider as wrong yaml syntax.
Can you please point me in right direction, how to make nested subitem in list as another list with text fields?
Much thanks in advance!
fields:
header.features:
name: features
type: list
label: Features
fields:
.icon:
type: text
label: Icon
.header:
type: text
label: Header
.text:
type: text
label: Text
Also, support for lists was improved in Grav 1.1. Check the 1.1 beta too, to see if your issue is solved in it.
Hey, thanks for the reply. Unfortunately you have pasted exactly the same code which I did, and this will not solve an issue. On your example: every feature should have additional nested list of text fields, besides of icon, header and text. I’ll show the code for better understanding:
features:
type: tab
title: Features
fields:
header.features:
name: features
type: list
label: Features
# set of fields for every feature
fields:
.icon:
type: text
label: Icon
.header:
type: text
label: Header
.text:
type: text
label: Text
# nested list of details for every feature
# does not work
.list:
type: list
label: feature details
fields:
type: text
label: detail
Hope this will make things more clear. I presume this is pretty easy, but I’m missing something…
Are you running Grav 1.1 beta? There was some extensive improvements made in 1.1. We are currently in beta with a new beta to be released today. If all goes well we plan on making it ‘final’ next week.