Skip to content

Feedback: How to configure an array field in the data screen #620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
davidsneighbour opened this issue Aug 14, 2023 · 3 comments
Closed
Labels

Comments

@davidsneighbour
Copy link
Contributor

It appears that the documentation either lost content or omits how to configure arrays in the data screen. I have the following configuration in data/files/kurzschnitte.json:

{
  "$schema": "https://frontmatter.codes/config/data.files.schema.json",
	"id": "kurzschnitte",
	"title": "Kurzschnitte",
	"file": "[[workspace]]/data/dnb/kollitsch/kurzschnitte.json",
	"fileType": "json",
	"labelField": "title",
	"singleEntry": false,
	"schema": {
		"title": "Kurzschnitte",
		"type": "object",
		"required": [
			"title",
			"link",
			"slug"
		],
		"properties": {
			"title": {
				"type": "string",
				"title": "Title"
			},
			"link": {
				"type": "string",
				"title": "Link"
			},
			"description": {
				"type": "string",
				"multiline": true,
				"title": "Description"
			},
			"labels": {
				"type": "array",
				"items": {
					"type": "string"
				}
			},
			"slug": {
				"type": "string",
				"title": "Kurzschnitt-Post"
			},
		}
	}
}

The screen shows the Labels field, but nothing happens on click. I would expect a string field to be added.

The documentation has nothing about array types that I can find. The samples also contain only string fields, so the label configuration is something I have from a config file from around 1 or 2 years ago.

What is the proper way to configure array fields?

@djmtype
Copy link

djmtype commented Aug 14, 2023

@davidsneighbour I'm facing the same issue. I posted my question on Discord because I don't know if the issue is with me or a bug with FrontMatter.

I've added my fields directly inside the JSON file to see if the FrontMatter UI would pick them up. It does. Through the UI, I can remove existing items belonging to an array as well as delete them, but I can not add more items.

If you're on Discord, here's the thread I started: https://discord.com/channels/992409023607476224/1140404917845119097

@estruyf
Copy link
Owner

estruyf commented Aug 16, 2023

Thanks @davidsneighbour and @djmtype; there seems to be something wrong with the array field. Will investigate this further.

@estruyf estruyf added the bug Something isn't working label Aug 16, 2023
estruyf added a commit that referenced this issue Aug 16, 2023
@estruyf
Copy link
Owner

estruyf commented Aug 16, 2023

Found the issue. This should work as expected in the latest beta version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants