Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/derrickmehaffy/strapi-test-v4-synced-content-types
Strapi v4 example of converting the schema.json files to .js and syncing two content-types
https://github.com/derrickmehaffy/strapi-test-v4-synced-content-types
Last synced: 29 days ago
JSON representation
Strapi v4 example of converting the schema.json files to .js and syncing two content-types
- Host: GitHub
- URL: https://github.com/derrickmehaffy/strapi-test-v4-synced-content-types
- Owner: derrickmehaffy
- Created: 2022-07-06T21:03:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-06T21:04:38.000Z (over 2 years ago)
- Last Synced: 2024-11-05T18:28:59.334Z (3 months ago)
- Language: JavaScript
- Size: 195 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Synced content-types example
**NOTE: You will not be able to use the content-type builder on any content-types using this method, if you do it will move them out of sync**
What has been done:
- Converted each content-type's `schema.json` to a `schema.js` file
- Created a central content-type storage location
- Import the central content-type and set the values (you can't just mirror the whole schema file as there is content-type independent settings)Content-types:
- [Company 1 Blog Posts](src/api/company-1-blog-post/content-types/company-1-blog-post/schema.js)
- [Company 2 Blog Posts](src/api/company-1-blog-post/controllers/company-1-blog-post.js)
- [Synced Blog Post content-type attributes](src/synced-content-types/blog-post/attributes.json)
- [Synced Blog Post content-type options](src/synced-content-types/blog-post/options.json)## Instructions to add new attributes
Edit the synced content-type's attribute file manually to modify both content-types. As mentioned in the note above it is not possible to use the content-type builder on content-types that are considered "synced".