Enhancement: Allow to create sub-content #576

Closed
opened 2026-10-05 02:53:58 +02:00 by adam · 1 comment
Owner

Discussed in https://github.com/estruyf/vscode-front-matter/discussions/715

Allow content to be created in a page bundle folder by specifying that the content is "sub-content". To support this, on the content type there should be two new properties introduced:

  • allowAsSubContent: Allows you to specify if you want to use the content type as a parent or create child-level content. This can be used in combination with the page pageBundle property. That way, you can create a hierarchy.
  • isSubContent: Specify this on the content-type if the content to be created with this is always going to be sub-content.

When the allowAsSubContent setting is enabled, the author should get the question to create it as sub-content or main content:

Xnapper-2023-12-07-10 33 39-CBB59F44-23D1-47CE-B11C-9BA860C09C99

When yes is picked, or when the subContent property is set to true, the author will get a dialog to pick the folder from the content location:

Screenshot 2023-12-07 at 10 34 06
### Discussed in https://github.com/estruyf/vscode-front-matter/discussions/715 Allow content to be created in a page bundle folder by specifying that the content is "sub-content". To support this, on the content type there should be two new properties introduced: - `allowAsSubContent`: Allows you to specify if you want to use the content type as a parent or create child-level content. This can be used in combination with the page `pageBundle` property. That way, you can create a hierarchy. - `isSubContent`: Specify this on the content-type if the content to be created with this is always going to be sub-content. When the `allowAsSubContent` setting is enabled, the author should get the question to create it as sub-content or main content: <img width="732" alt="Xnapper-2023-12-07-10 33 39-CBB59F44-23D1-47CE-B11C-9BA860C09C99" src="https://github.com/estruyf/vscode-front-matter/assets/2900833/01489169-c934-470a-9a4d-ebdf40bd1aac"> When `yes` is picked, or when the `subContent` property is set to `true`, the author will get a dialog to pick the folder from the content location: <img width="692" alt="Screenshot 2023-12-07 at 10 34 06" src="https://github.com/estruyf/vscode-front-matter/assets/2900833/7b9cc3bf-305a-4f28-96d6-8ac324a9194f"> <!-- github-sync-id:2030315011 -->
adam closed this issue 2026-10-05 02:53:58 +02:00
Author
Owner

First implementation is in place and it can be tested out with the latest beta version.

Example of a parent configuration which can be used for both creation as page bundle or sub-content:

{
  "frontMatter.taxonomy.contentTypes": [
    {
      "name": "parent",
      "pageBundle": true,
      "previewPath": null,
      "allowAsSubContent": true,
      "fields": [
        ...
      ]
    }
  ]
}

Example of a child configuration:

{
  "frontMatter.taxonomy.contentTypes": [
    {
      "name": "child",
      "pageBundle": true,
      "previewPath": null,
      "isSubContent": true,
      "fields": [
        ...
      ]
    }
  ]
}
First implementation is in place and it can be tested out with the latest beta version. Example of a parent configuration which can be used for both creation as page bundle or sub-content: ```json { "frontMatter.taxonomy.contentTypes": [ { "name": "parent", "pageBundle": true, "previewPath": null, "allowAsSubContent": true, "fields": [ ... ] } ] } ``` Example of a child configuration: ```json { "frontMatter.taxonomy.contentTypes": [ { "name": "child", "pageBundle": true, "previewPath": null, "isSubContent": true, "fields": [ ... ] } ] } ``` <!-- github-comment-id:1845047399 -->
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#576