Issue: Template is not applied to new content type when created #738

Closed
opened 2026-10-05 03:02:59 +02:00 by adam · 2 comments
Owner

Describe the bug

I have defined a content type and along with it, a new template. When creating a piece of content using the "create content" button, the default template is used.

To Reproduce

  1. Create a new content type:
{
    "$schema": "https://frontmatter.codes/config/media.contenttypes.schema.json",
    "name": "project",
    "pageBundle": false,
    "previewPath": null,
    "template": "[[workspace]]/.frontmatter/templates/project.md",
    "clearEmpty": true,
    "fields": [ ...
  1. Create a new template in .frontmatter/templates/ called project.md:
---
title: "{{title}}"
date: "{{now}}"
draft: true
project:
  type: Portfolio
  client: Example
  clientURL: https://example.com
  colour: blue
---
  1. Assign the content type to a page folder:
{
    "$schema": "https://frontmatter.codes/config/content.pagefolders.schema.json",
    "title": "Projects",
    "path": "[[workspace]]/content/en/projects",
    "defaultLocale": "en",
    "contentTypes": ["project"],
...

Use the "Create content" button on the dashboard, select the project folder and the template is not used.

Expected behavior

I believe the functionality should work as described here.

Device:

  • OS: Fedora 42
  • Front Matter CMS Version: 10.7.0
  • Browser: All
**Describe the bug** I have defined a content type and along with it, a new template. When creating a piece of content using the "create content" button, the default template is used. **To Reproduce** 1. Create a new content type: ```json { "$schema": "https://frontmatter.codes/config/media.contenttypes.schema.json", "name": "project", "pageBundle": false, "previewPath": null, "template": "[[workspace]]/.frontmatter/templates/project.md", "clearEmpty": true, "fields": [ ... ``` 2. Create a new template in `.frontmatter/templates/` called `project.md`: ```markdown --- title: "{{title}}" date: "{{now}}" draft: true project: type: Portfolio client: Example clientURL: https://example.com colour: blue --- ``` 3. Assign the content type to a page folder: ```json { "$schema": "https://frontmatter.codes/config/content.pagefolders.schema.json", "title": "Projects", "path": "[[workspace]]/content/en/projects", "defaultLocale": "en", "contentTypes": ["project"], ... ``` Use the "Create content" button on the dashboard, select the project folder and the template is not used. **Expected behavior** I believe the functionality should work as [described here](https://frontmatter.codes/docs/content-creation/content-types#using-a-template-with-the-content-type). **Device:** - OS: Fedora 42 - Front Matter CMS Version: 10.7.0 - Browser: All <!-- github-sync-id:3036613330 -->
adam closed this issue 2026-10-05 03:02:59 +02:00
Author
Owner

This will be testable in the latest beta version.

This will be testable in the latest beta version. <!-- github-comment-id:4060236568 -->
Author
Owner

Thanks for the fix. Tested and working :)

Thanks for the fix. Tested and working :) <!-- github-comment-id:4267000196 -->
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#738