You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/5.x/system/project-config.md
+12-7Lines changed: 12 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,12 @@
1
1
# Project Config
2
2
3
-
Craft tracks system settings in a centralized store called _Project Config_. Changes are recorded as YAML files in the `config/project/` folder, which can be version-controlled alongside your templates and other front-end resources.
3
+
Craft tracks system settings and content schema in a centralized store called _Project Config_. Changes are automatically written to YAML files in the `config/project/` folder, which can be version-controlled alongside your templates and other front-end resources.
4
+
5
+
<!-- more -->
4
6
5
7
This workflow provides two main benefits:
6
8
7
-
1. Your [project’s state](#whats-stored-in-project-config) is tracked over time.
9
+
1. Your [project’s state](#scope) is tracked over time.
8
10
2. Settings are [automatically propagated](#propagating-changes) to other development/staging/production environments.
9
11
10
12
The overarching principle behind Project Config is to separate the management of content and settings. In doing so, it’s possible to establish a one-way flow for configuration, and to tie settings and schema to the rest of your project’s code.
@@ -22,10 +24,9 @@ Broadly speaking, Project Config tracks things that are managed via the **Settin
22
24
- Craft and plugin schema versions
23
25
- Craft edition
24
26
- Email settings
25
-
- Fields, field groups, and all field layouts
27
+
- Fieldsand field layouts
26
28
- Global sets (settings only, not their content)
27
29
- GraphQL schemas, and the access settings for the public schema
28
-
- Matrix block types
29
30
- Plugin versions, editions, and settings
30
31
- Routes defined in **Settings** → **Routes**
31
32
- Sections and entry types
@@ -42,15 +43,19 @@ Plugins and Modules can store their own settings in Project Config, too. See [Su
42
43
43
44
Project Config is always active, but you may need to adjust your workflow to get the most out of it.
44
45
45
-
Use of Project Config often involves disabling the <config5:allowAdminChanges> option in all but development environments, which makes the **Settings** section of the control panel inaccessible—even for admin users. This guarantees settings are only changed under circumstances where their effects can be tested alongside any relevant templates or code.
46
+
Use of Project Config often involves disabling the <config5:allowAdminChanges> option in all but development environments, which puts the **Settings** section of the control panel in read-only mode—even for admin users. This guarantees settings are only changed under circumstances where their effects can be tested alongside any relevant templates or code.
46
47
47
48
Suppose you are asked to add a new entry type to an existing section. The process is probably pretty familiar: make some updates via the control panel, adjust templates and styles, then push your code. But how does the new entry type definition actually make it to the live site?
48
49
49
50
-**Without** Project Config, you would eventually need to squash a live database with a development one (risking content loss), or copy settings from one control panel to another (risking misconfiguration).
50
51
-**With** Project Config, Craft tracks the schema changes as YAML and can apply them automatically (as part of your deployment process) or at the click of a button.
51
52
52
53
::: warning
53
-
Never directly edit YAML files. Missing changes in other parts of the Project Config that should be made simultaneously can cause inconsistencies and instability.
54
+
Directly editing YAML files can cause inconsistencies and instability.
55
+
Craft should have exclusive control over the `config/project` directory.
56
+
57
+
This applies to LLMs and coding agents, as well: their training data will include configuration from many different (incompatible) versions of Craft.
58
+
Invalid configuration puts your data and access at risk.
54
59
:::
55
60
56
61
## Propagating Changes
@@ -90,7 +95,7 @@ Project Config simplifies collaboration on big features by letting you share ver
90
95
Merge conflicts _can_ still happen (when two contributors modify the same setting), but resolving them is rarely more difficult than a template or stylesheet—you’ll just have to run `php craft project-config/touch` and then `php craft project-config/apply` to ensure the final result is applied.
91
96
:::
92
97
93
-
Any time you integrate new code into an environment (say, while developing locally, or deploying to a server), run `craft up` to apply pending migrations and project config changes.
98
+
Any time you integrate new code into an environment (say, while developing locally, or deploying to a server), run `craft up` to apply pending migrations and Project Config changes.
0 commit comments