dot in blueprint key
i’m making a blueprint for collections for @page.pages only, as a list field like so:
header.content.items:
type: list
fields:
[email protected]:
type: pages
but this produces:
content:
items:
-
'@page':
page: /slug
which then doesn’t work for the templates.
i’ve tried different ways of escaping it, getting different results, but none of them working. a couple of examples:
.'@page.page':
content:
items:
-
'''@page':
'page''': /slug
content:
items:
-
'''[@page':
page: /slug
.[@page.page]:
content:
items:
-
'[@page':
page: /slug
doing it as a single value field, with [email protected] / header.content.items[@page.page], gives similar results.
is this the intended behavior? is there a way to achieve this, or a workaround?
Umm, that looks wrong. What are you trying to do? The collections are defined by data, not by blueprint.
the blueprint is for the form to ask for the data, so say the first code i’m referring to is in /blueprints/pages/collection.yaml, and the result i’m talking about is in /pages/slug/collection.md.
Alright. So you need to implement this in a bit different way. Maybe use the list field where you can choose the key and value / list of values.
yeah, no. i tried that too before, but the array field doesn’t allow multiple values with the same key; so, if i try to add multiple @page.pages, only the last one in the list is saved. and i also would like the user to be able to just select a page from a list — the array field consists of textfields only.
either way, i believe the problem i’m presenting here is something that should be addressed?
yeah, no. i tried that too before, but the
arrayfield doesn’t allow multiple values with the same key; so, if i try to add multiple@page.pages, only the last one in the list is saved. and i also would like the user to be able to just select a page from a list — thearrayfield consists of textfields only.either way, i believe the problem i’m presenting here is something that should be addressed?
you want dropdown select instead textfields?
Duplicate of #783?