If you are planning to explore Contentstack and its features, this should be your starting point. The guide covers the fundamentals of Contentstack as well as quick round-up of everything that it offers.
Hierarchy of Data in Contentstack
In Contentstack, data is structured and categorized in these four components: Organization, Stack, Content Type, and Content (Entries and Assets).
Here’s a detail of the data hierarchy:
- Organization acts as a parent entity that encapsulates all the resources, belonging to your company, and your users together. You can connect and share resources with anybody within your company via email invite.
- Stacks serve as a collaboration space that holds all the content related to a particular project, and stack users can work together to create, edit, approve, and publish content.
- Content types let you define the structure or blueprint of a page or a section of your web or mobile property. Content type consists of fields which are the building blocks for structured content. Using content types, you can create content of the same nature and pattern.
- Content comprises Entries and Assets. Entries are pieces of content created using the defined content types, and assets are any media files such as images, videos, and documents that you upload to your stack.
Learn about the overall hierarchy of elements of Contentstack in our Key Concepts section.
Start Using Contentstack
To start using Contentstack, a user needs to be part of a Contentstack Organization. Users can either be invited to an existing organization, or sign up individually.
Create a Stack
Stacks form an integral part of your Organization because all your Contentstack content resides here. Everything related to your site such as content types, entries, assets, localization settings (for publishing content in different languages), environments, and other settings reside within Stacks.
After logging in to your Contentstack, you will see the DASHBOARD page that displays the recently modified entries and assets of your stack. Click on CONTENT and perform the following steps to start creating a stack:
- Click on the + New Stack button at the top-right corner.
This opens the Create New Stack dialog box, where you need to enter the following details:
- Name (mandatory field): Enter a name for your stack. This can be your project name, say “My Site.”
- Description (optional field): Enter a specific description for your stack. This could be anything relevant to your project.
- Master Language (mandatory): Select the primary language of the stack, say “English - United States”.
- Click on Create.
This creates your “My Site” stack.
Next, you need to model the content type of your webpage.
Additional Stack Settings
- Stack Settings: You can access the API key and Access Token of the stack to retrieve content through Contentstack’s APIs.
- Transfer Stack Ownership: You can transfer the ownership or make another user the owner of your stack in a few clicks. Once transferred, you will no longer have the rights to make any changes to the stack or to the content within.
- Stack Dashboard: You can customize your stack Dashboard page, by adding your own dashboard widgets or using the default dashboard widgets to personalize it.
Create a Content Type
Content types define the structure or blueprint of your web page designed to capture content elements such as text, images, or files. They are more like an outline for your content.
First you need to define your content type, then add fields to it. Let’s look at the steps in detail.
A. Define you Content Type
Let’s look at the steps to create your content structure.
- After creating your stack, you will be led to the stack repository page where you will need to click on the + New Content Type button.
- This opens the Create New Content Type form where you will need to enter the basic details of the stack.
- Based on the structure of your webpage or your digital property, select the “type”: Webpage (e.g., homepage, contact page, etc.) or Content Block (e.g., header, footer, menu, etc.)
- Provide a suitable Name for your content type. The Unique ID field gets automatically populated based on the name entered. You can edit the Unique ID value as per your requirement.
- Mark your content type as either Single (create one-off entries) or Multiple (create multiple entries using the same content structure).
- After filling the above details, you have a choice to add a Description for your content type.
- Finally, click on Create and Add fields and you are ready to add fields in your content type.
This sets the nature and behavior of your content type. Now, you need to add fields and modify its properties as per your requirements.
B. Add fields to your Content Type
Next, you need to add fields to your content type. You can either click on a specific field or drag and drop the fields from the Fields list displayed at the right-hand side.
After adding the relevant fields, you can modify the field properties by clicking on the relevant field and making changes to them on the Edit Properties section that opens up on the right-hand side of the page.
Finally, click on either Save or Save and Close to start using your content type. You can now use this content type to create entries.
This concludes the Content Modeling process where you have modeled your content type, i.e., your content structure. You can use this content type to start adding entries.
Additional Settings that you can apply to your content type
- Field Visibility Rules: Field visibility rules allow you to define certain rules, or conditions, for certain fields, which makes it possible to display or hide their associated fields, while creating an entry.
- Default URL Pattern: When setting the properties of the URL field, you can set a default URL for the field.
Environments correspond to one or more deployment servers or a content delivery destination where you need to publish your content. Let’s see how to create and start using your environment.
A. Add an Environment
To create an environment, perform the steps given below:
- Click on the “Settings” cog and select Environments. Here, you will see the list of all the environments that you will be creating for your stack.
- Click on + New Environment to create a new environment. The Create Environment dialog box that appears allows you to add the following details:
- Enter environment name: Enter the name of your choice (e.g., staging, development, and production).
- Specify base URL: The Base URL is used as a prefix when the URL of an entry is generated. It is important to note that base URL would be different if using different languages (for example, http://www.example-site.com/en/).
Note: In case of mobile apps or other devices, keep it blank as they fetch content directly from Contentstack servers through APIs.
- Advanced settings: The Advanced option lets you add servers and deploy content to them.
- Finally, click on Create.
You can even Preview your content on the environment to check whether you have successfully published your content or not.
B. Create Delivery Tokens
To provide read-only access to the associated environments you can make use of Delivery Tokens, along with the stack API key, to retrieve published content of a specific environment via API Requests.
You need to create new tokens for the environments of your stack as each token is associated with only one environment. You can create different tokens for different publishing environments of your stack.
You are now ready to start publishing/unpublishing your content in your created environment. But, before that, you can first add collaborators to your stack.
Add Users to Stack and Assign Roles
A user, if has the required permission, can invite other users to collaborate on a stack. To add a new user, perform the following steps
- Hover on the “Settings” cog at the top of the window and select Users. Here, you can see the list of all existing users (collaborators) of the stack along with their details.
- Click on the + Invite User button at the top right-hand side corner of the page.
- In the Invite User form that opens, enter the email ID(s) of the user(s) you wish to invite and share the stack with. You also need to assign a role(s) to the user(s) while sharing the stack.
- You can enter a short message that goes along with the invitation. This is an optional step.
- Click on Invite.
Once the invited user accepts the invitation, he/she can collaborate with you on the specified stack.
On the basis of assigned stack role, the invited users can then log in to the platform and start working with you on your stack accordingly.
Create Content (Entries and/or Assets)
To start adding content, you need to create an entry. Entries can only be created for existing content types. So, to create a new entry, perform the following steps:
- Click on the content type for which you want to create an entry.
- Each entry has a Title field. Enter a relevant title for the content in this field. If you have added the “Webpage” content type, you will also find a URL field. Here, you need to provide the relative path for the page, without the base URL (for example, /contact_us, /blog/new_post, etc).
- Add the relevant data for the rest of the fields, depending on the kind of content type created.
- Finally, Save or Publish your entry. You need to publish an entry only in an available environment(s).
Next, we’ll see how to publish your content.
Additional Settings for Entries
- User and Role Settings: To control user access levels within your Contentstack stack, you can assign specific Stack roles to your users. A role comprises of a collection of permissions that will be applicable to all the users who are assigned a specific role.
By default, you will find four roles: “Owner,” “Admin,” “Developer,” and “Content Manager,”. You can even create a “Custom role” to suit your requirement.
Once you create an entry, you can publish it to one of the available publishing environments.
To publish an entry, add the required content on the entry page, and click Publish. You will notice a dialog box with the following publishing options:
- Environment: Select the environment to which you wish to publish the entry. You can select multiple environments at one go.
- Language(s): Publish the content in different languages by selecting the language you wish to publish the entry in. This option is available only if multiple languages are added to your stack.
- Publish At: This option provides you with two sub-options – Publish Now and Publish Later.
- Publish Now allows you to publish an entry immediately.
- Publish Later allows you to publish an entry at a later date/time. If you select the 'Publish Later' sub-option, a text box appears asking you to select the date and time of publishing. On clicking this text box, you will be prompted to enter the exact date, time (hour-min-sec), and the time zone.
Other features that help in publishing content
- Bulk Publish/Unpublish: Send multiple entries at once for publishing or unpublishing.
- Releases: This feature really comes in handy allow you to pin all the required entries and assets to a ‘Release’ and publish/unpublish them at the same time to whatever environment you choose.
- Publish Queue: It lets you view the details of the entries/assets that you sent for publishing/unpublishing. The details include time, entry, content type, version, language, user, environment, and status.
- Audit Log: It records information of all the activities performed in a stack and helps you to keep track of all published items, updates, deletes, and current status of the existing content.
Congrats! You’ve taken your first step in learning how to use Contentstack. There are lots of other resources that you and your team can try out.
- Quickstart in 5 mins: Try creating your own webpage in less than five minutes.
- Modular Blocks: Modular Blocks is a field that allows content managers to dynamically create and modify components of a page or app on the go.
- Extensions: They come in handy when you want to customize Contentstack experience. They help you to customize Contentstack's default UI and behavior. You can create Custom Fields, Custom Widgets, and Dashboard Widget.
- Webhooks: Webhooks are HTTP callbacks that send notifications (with real-time information) to a specific URI defined in the Webhook definition when triggered by events against content types, entries, or assets.
- Workflows: To streamline the process of content creation, review, approval, and publication you can set up Workflows. They let you define stages through which your content needs to go, assign entry stages to users, add publishing approval rules, and do a lot more, throughout your project lifecycle.
- Localization: Using this feature, add multiple languages to your stack and publish your entries in multiple languages.
- Data Synchronization: It allows you to sync content between Contentstack server and your local server, database, or device. Contentstack offer DataSync, Sync APIs, and other syncing tools, lets you synchronize all your content with Contentstack.
- REST API requests: You can try out our REST APIs for performing any activities with your content.
- Stack Management Tokens: These tokens provide read-write access to the content of your stack. Used along with the stack API key, it lets you execute authorized Content Management API requests for managing published as well as unpublished (draft) content of your stack.
- GraphQL APIs: Our read-only set of GraphQL APIs lets you fetch a customized response or retrieve data of nested or multiple resources (both entries and assets across multiple content types) through a single API request.
- Platform-specific SDKs: We have created SDKs, API references, and example apps for some of the popular languages and platforms. Use them to build apps and get content from Contentstack.