-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow sections, categories and fields to be "scaffolded" #881
Comments
This is already possible using 'The Architect' plugin. https://github.com/Pennebaker/craftcms-thearchitect |
Basically, what Craft needs is an easy way to generate migrations, similar what the Artisan CLI provides for Laravel (https://laravel.com/docs/5.3/migrations#generating-migrations). Additionally, I was just thinking that it would be awesome if Craft would provide a mechanism for seeding (also like Laravel, see https://laravel.com/docs/5.3/seeding). |
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. |
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. |
This is technically complete in the latest beta, although a complete "scaffold" might not be in place yet... |
Technically done in a basic sense, but will leave open since we plan to flesh out the features more. |
Closed via 3878d16 |
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.
The text was updated successfully, but these errors were encountered: