Craft would be so much better if only…

Allow sections, categories and fields to be "scaffolded"

There are quite a few situations where it would be great to have a simple file type (we could check into version control) that lets us setup a section, categories and fields. This leaves the concern that it could possibly overwrite the changes made in the CMS so a mechanism to “scaffold” the sections through the control panel, or more preferably during a Craft CMS installation, would be a great addition to our workflow.

This would also help Craft with CI. Being able to scaffold the main pieces of the CMS would allow testing critical pieces of the application (we would probably need a way to seed content into the CMS as well).

------

Original idea:

Some CMSs - eg, Bolt and Kirby - require sections and fields to be created with a YAML file. This means that setting up a new site similar to a previous build is very quick: just a matter of copy+paste.

Whilst I don't think that the process of creating sections and fields in Craft should be like this, it would be great to have this as *one method* of setting up a site.

The way I imagine this working is that the Control panel has a section where you can upload a YAML file detailing some fields and/or sections that you'd like created. Craft would then read this file and generate the relevant tables and rows in the DB based on its content. These would then appear and be visible and usable like sections and fields generated in the usual manner.

In this way, this feature would not force current developers to change their method of setting up Craft sites, but would allow some developers to speed up their workflow.

18 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Jason McCallisterJason McCallister shared this idea  ·   ·  Admin →
    Anonymous shared a merged idea: Create new fields and sections with YAML  ·   · 

    4 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Kyle WeishauptKyle Weishaupt commented  · 

        This would be an amazing addition. I currently re-use a lot of fields, so it would be helpful to quickly add them to new projects.

      • Anonymous commented  · 

        Some CMSs - eg, Bolt and Kirby - require sections and fields to be created with a YAML file. This means that setting up a new site similar to a previous build is very quick: just a matter of copy+paste.

        Whilst I don't think that the process of creating sections and fields in Craft should be like this, it would be great to have this as *one method* of setting up a site.

        The way I imagine this working is that the Control panel has a section where you can upload a YAML file detailing some fields and/or sections that you'd like created. Craft would then read this file and generate the relevant tables and rows in the DB based on its content. These would then appear and be visible and usable like sections and fields generated in the usual manner.

        In this way, this feature would not force current developers to change their method of setting up Craft sites, but would allow some developers to speed up their workflow.

      Feedback and Knowledge Base