Skip to content

Creating Recipes

Tim Erickson edited this page Feb 17, 2021 · 4 revisions

Create your own recipe

Keep the following items in mind. There is currently no tool or clean way to export a batch of config files that make up a recipe. You will need to pick out the necessary config files and bundle them together manually. One option for making this a little easier is to follow this process.

  1. Export your current config files and commit them to a github repo
  2. Make the configuration changes to your Backdrop CMS site that you wish to include in the recipe
  3. Export the files to the same github repo you established in step #1 and create a diff file to see which files are new and which ones have changed.

Any files that have changed will be problematic, because our current process for importing recipes does not allow for updating existing config. Ideally, your recipe will consist entirely of new config files.

Do not use existing fields for views.

At this time, config recipes should NOT include existing fields (or any config files that already exist). Our current tool "Config Batch Import" does not support the import of config files that already exist.

Do not use the existing Body field for config recipes. You should make your own new and unique field to use instead of the default body field.

Submitting your config recipe

The best tool we have at the moment for reading config recipes is Config Batch Upload which requires that recipes meet the following criteria:

  1. They are stored in .tar file (must be .tar).
  2. All of the config recipes are included together in the .tar file without a parent directory

This command should work to create a tar file with all the necessary config files and without the parent directory.

cd config-directory/ && tar -zcvf ../config-recipe.tar . && cd -

config-directory is the directory containing the files you wish to bundle. config-recipe is the name of your .tar file.

File Structure and Contents of Config Recipe

If you are submitting your config recipes for inclusion in this library, it should include a readme.txt file that lists all the included config files AND any module dependencies. It should include each config file independently and a tar file with all of them combined.

File structure

Example:

Locations

  • readme-locations.txt
  • field.field.field_location_address.json
  • field.field.field_location_geofield.json
  • field.instance.node.location.body.json
  • field.instance.node.location.field_location_address.json
  • field.instance.node.location.field_location_geofield.json
  • node.type.location.json
  • views.view.locations.json
  • location.tar
Clone this wiki locally