decaporg / decaporg/decap-cms

Support entry post templates

Open
#3,488 4 comments 2 reactions 0 assignees View on GitHub
pinned type: feature
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**Is your feature request related to a problem? Please describe.**

I have been using Netlify CMS for a short while, mostly for my team's wiki so we use a template for creating our wiki entries. Currently, we have a template in our collection that we duplicate but as the site has grown in entries it has become increasingly laborious to go to the template and duplicate each time we make a post.

**Describe the solution you'd like**

What would be really great is if when we create a new entry for a collection we can assign a default template to use when creating a new post for example

![Screenshot from 2020-03-28 11-58-28](https://user-images.githubusercontent.com/26552540/77820507-80474000-70eb-11ea-932f-e8583668f360.png)

when clicking the _"New RFCs"_ button instead of being presented with a blank entry we can use a template for the RFC then be presented with the template text already in the editor like this:

![Screenshot from 2020-03-28 12-00-27](https://user-images.githubusercontent.com/26552540/77820554-c1d7eb00-70eb-11ea-87da-db86bfb27a24.png)

In the `config,yml` file we could have a field called `new_entry_template`:

```yml
collections:
- label: RFCs
name: rfcs
folder: rfcs
slug: "{{title}}"
create: true
new_entry_template: rfcs/template.md
editor:
preview: false
fields:
- label: Title
name: title
widget: string
- label: Summary
name: summary
widget: text
required: true
hint: What is the overall goal of this RFC?
- label: Body
name: body
widget: markdown
- label: Sidebar
name: sidebar
widget: hidden
default: true
```

**Describe alternatives you've considered**

Well, the only alternative that I know of so far is to duplicate an existing entry in a collection or have a `template.md` file in a collection that we can duplicate every time but this just pollutes the entries in the CMS and does not really solve the problem at hand

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.