I am just starting with Strapi and I created a Single type using the Content-Type Builder UI in admin, I then configured the view and saved everything. But where is this stored so I can import it in production when deploying the site?
Every time I do strapi build
the modifications I made to Configure the view disappears.
src/api/setting/content-types/about/schema.json
is not updated on admin save, I am very confused about how to save my customization
For example I created this one
{
"kind": "singleType",
"collectionName": "abouts",
"info": {
"singularName": "about",
"pluralName": "abouts",
"displayName": "about"
},
"options": {
"draftAndPublish": false,
"comment": ""
},
"attributes": {
"Title": {
"type": "string"
},
"Phone": {
"type": "string"
}
}
}
it shows up like this:
after I change the content view:
but schema.json file content is the same as before, how can I make sure it is saved?
The configuration of components doesn’t store on scema files. You need to dump the config to a file and restore it if the configuration is removed. This file will also include your help text which you have below the fields. Here is the reference - CLI - Strapi Developer Docs
I am using below below scripts in package.json to dump and restore the config
"dump:config": "strapi config:dump -pf strapiConfig.json",
"restore:config": "strapi config:restore -s replace -f strapiConfig.json",
On the server you can run restore:config
before yarn start
to get the component configuration same as on your local.
1 Like
Thanks @Meher_Chandan
I think it would be great to have this in the schema, I wonder if there were discussions regarding this.
something like
"attributes": {
"title": {
"type": "string",
"label": "Title",
"width": "100%",
"description" : "Add title"
},
}
anyone from the core team can comment on this? has something like this been discussed before?
2 Likes