How to Share Object Schemas in Cosmic JS


An Object in Cosmic JS can be a page, a blog post, an author or anything you want it to be. Cosmic JS gives you the freedom to create and manage content openly and create your own data structure. Each Object allows for the creation of a title, slug, content and Metafields. Metafields are very powerful pieces of custom data that can be added to objects that can be recursively nested. 

Depending on your use case, your Objects' Content Models can become quite robust with metafields. Save time creating new Objects with sharable Object Schemas. Cosmic JS makes sharing Object Schemas easy. Simply follow these steps: 


How to Share Object Schemas in Cosmic JS

1. Click "View Schema" on an existing Object and copy the code in the text area.


2. Paste into the Schema area in a new or existing Object.


Make sure that your Schema is a valid JSON Object structure. For example:

{
  "title": "Object Title",
  "content": "

Here is some amazing content.", "metafields": [ { "title": "Headline", "key": "headline", "value": "Amazing Headline", "type": "text" } ] }

This is another great example of Cosmic JS helping blended teams of developers and content editors build apps faster. With Cosmic JS, write once and deliver everywhere. 

I hope that you've found this tutorial helpful. If you have questions or comments about Content Editor Features in the Cosmic JS system, I'd love to hear about them. You can refer to my Cosmic JS Profile for additional content on how to intuitively navigate the Cosmic JS Dashboard. 

carson@cosmicjs.com 

Was this article helpful?

Thank you! Your input helps us improve our articles and resources. If you have any other questions or comments, please contact support.

You may also like


Cosmic JS makes it easy to manage content for your Vue.js applications. In this blog we'll quickstart a Vue.js RPG Adventure Game using the Cosmic CLI. Our game, "Enter The Cosmos", is a turn-based, RPG style game built using Vue.js, Node.js and Cosmic JS.
Learn how I built the Twitter Search Extension to search and save Tweets to your Bucket.
Digital Ocean, a hosting provider beloved by developers, provides a highly intuitive interface for deploying and managing application infrastructure. In this tutorial I'm going to show you how to install and deploy a Cosmic-powered Nuxt.js app on Digital Ocean.
Here we build a progressive web app in React.js with the power of Cosmic JS. It respond with status 200 and carries data when you disconnected to internet and in Chrome browser (both mobile and desktop) it gives an option to install the app on home screen.
To demonstrate how easy it is to get started with Cosmic JS, we'll utilize the Cosmic JS CLI to quickstart an Angular Ecommerce App. This Angular ecommerce app allows you to process orders from customers and accept Stripe payments for goods and services. Manage inventory in the Cosmic JS Dashboard.
Eliminate the language barrier between you and the opinions of your customers