Issue: multiple dataFile types in contentTypes returns null label for some data #457

Closed
opened 2026-10-05 02:48:22 +02:00 by adam · 3 comments
Owner

Hi! I'm not sure it's really a bug, but I can't reach out for solution.

With the contentTypes fields containing multipule dataFile type, no labels appear for some of data, not appropriate dropdown list either.

sidebar sidebar

markdown file frontmatter

---
title: Ad est et ullam sequi aut optio rerum.
categories:
  - culpa
tags:
  - sequi
---

frontmatter.json

"frontMatter.data.files": [
    {
      "id": "categories",
      "title": "Categories",
      "file": "[[workspace]]/data/category.json",
      "fileType": "json",
      "labelField": "name",
      "schema": {
        "title": "Category",
        "type": "object",
        "required": ["slug", "name"],
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          }
        }
      }
    },
    {
      "id": "tags",
      "title": "Tags",
      "file": "[[workspace]]/data/tag.json",
      "fileType": "json",
      "labelField": "name",
      "schema": {
        "title": "Tag",
        "type": "object",
        "required": ["slug", "name"],
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          }
        }
      }
    }
  ],
"frontMatter.taxonomy.contentTypes": [
    {
      "name": "default",
      "pageBundle": false,
      "previewPath": null,
      "fields": [
        {
          "title": "Title",
          "name": "title",
          "type": "string"
        },
        {
          "title": "Categories",
          "name": "categories",
          "type": "dataFile",
          "dataFileId": "categories",
          "dataFileKey": "slug",
          "dataFileValue": "name",
          "multiple": true
        },
        {
          "title": "Tags",
          "name": "tags",
          "type": "dataFile",
          "dataFileId": "tags",
          "dataFileKey": "slug",
          "dataFileValue": "name",
          "multiple": true
        }
      ]
    }
  ]

/data/category.json

[
  {
    "name": "Culpa",
    "slug": "culpa"
  },
  {
    "name": "Ab",
    "slug": "ab"
  },
  {
    "name": "Cupiditate",
    "slug": "cupiditate"
  }
]

/data/tag.json

[
  {
    "name": "Dicta",
    "slug": "dicta"
  },
  {
    "name": "Et",
    "slug": "et"
  },
  {
    "name": "Sequi",
    "slug": "sequi"
  }
]

Desktop:
OS: Windows 11
Editor: VS Code 1.77.3
Front Matter 8.4.0

The data view on the dashboard works fine.

Thanks in advance for any responses!

Hi! I'm not sure it's really a bug, but I can't reach out for solution. With the contentTypes fields containing multipule dataFile type, no labels appear for some of data, not appropriate dropdown list either. <img width="218" alt="sidebar" src="https://user-images.githubusercontent.com/67089907/234482697-51f31bb3-c7d1-4739-809f-cf494e4c9c77.png"> <img width="221" alt="sidebar" src="https://user-images.githubusercontent.com/67089907/234485306-19634cd1-d931-4cc3-9422-95c7c0029b8b.png"> markdown file frontmatter ``` --- title: Ad est et ullam sequi aut optio rerum. categories: - culpa tags: - sequi --- ``` frontmatter.json ``` "frontMatter.data.files": [ { "id": "categories", "title": "Categories", "file": "[[workspace]]/data/category.json", "fileType": "json", "labelField": "name", "schema": { "title": "Category", "type": "object", "required": ["slug", "name"], "properties": { "name": { "type": "string", "title": "Name" }, "slug": { "type": "string", "title": "Slug" } } } }, { "id": "tags", "title": "Tags", "file": "[[workspace]]/data/tag.json", "fileType": "json", "labelField": "name", "schema": { "title": "Tag", "type": "object", "required": ["slug", "name"], "properties": { "name": { "type": "string", "title": "Name" }, "slug": { "type": "string", "title": "Slug" } } } } ], "frontMatter.taxonomy.contentTypes": [ { "name": "default", "pageBundle": false, "previewPath": null, "fields": [ { "title": "Title", "name": "title", "type": "string" }, { "title": "Categories", "name": "categories", "type": "dataFile", "dataFileId": "categories", "dataFileKey": "slug", "dataFileValue": "name", "multiple": true }, { "title": "Tags", "name": "tags", "type": "dataFile", "dataFileId": "tags", "dataFileKey": "slug", "dataFileValue": "name", "multiple": true } ] } ] ``` /data/category.json ``` [ { "name": "Culpa", "slug": "culpa" }, { "name": "Ab", "slug": "ab" }, { "name": "Cupiditate", "slug": "cupiditate" } ] ``` /data/tag.json ``` [ { "name": "Dicta", "slug": "dicta" }, { "name": "Et", "slug": "et" }, { "name": "Sequi", "slug": "sequi" } ] ``` **Desktop:** OS: Windows 11 Editor: VS Code 1.77.3 Front Matter 8.4.0 The data view on the dashboard works fine. Thanks in advance for any responses! <!-- github-sync-id:1684431684 -->
adam closed this issue 2026-10-05 02:48:22 +02:00
Author
Owner

Thank you @mayumih387 for opening this issue! Will check what is going wrong.

Thank you @mayumih387 for opening this issue! Will check what is going wrong. <!-- github-comment-id:1522984324 -->
Author
Owner

Thanks for providing the sample configuration; this helped a lot. I found the issue and also fixed it. You can test it out in the latest BETA version.

Thanks for providing the sample configuration; this helped a lot. I found the issue and also fixed it. You can test it out in the latest BETA version. <!-- github-comment-id:1523020142 -->
Author
Owner

Thank you for your quick response and the bug fix!

I've checked the BETA v8.5.4806699 and it worked as expected.

Thank you for your quick response and the bug fix! I've checked the BETA v8.5.4806699 and it worked as expected. <!-- github-comment-id:1523229005 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#457