In this tutorial, we will create a simple "Article" content type — follow this step-by-step guide to create your first content type in dotCMS.
Our new Article content type will have the following fields:
Title
Publish Date
Tags
Image/Asset
Rich Text Block
Navigate to Content Model > Content Types
This will take you to the Content Types Manager where you can view, create, and manage content types.
Add New Content Type
Click on the ➕ (plus) icon and you should see a dropdown list of the different "base" types of content that you can create. Each of these base types serve a different purpose — click to learn more about dotCMS base types. For this tutorial, let's choose Content.
Configure Basic Settings
Under
Content Name
, type Article.The name you enter is, simply enough, what you'll be calling the content type. (It also helps determine its system variable name, but don't worry about that for now.)
Provide a brief
Description
of the content type for future reference.Choose an
Icon
that represents this content type.For example, you can type "article" again and pick the resulting icon.
The
Site or Folder
field determines where the content type and its individual content items (or contentlets) will live by default.In this case, we'll leave this field as we found it.
Specifying a site or folder is especially useful when utilizing dotCMS's multi-tenancy support.
Set
Workflow
to the System Workflow.Content in dotCMS can have one or more publishing workflows that allow for fine-tuned control of the content lifecycle.
The System Workflow is the quickest way to access the most basic controls — such as Saving, Publishing, Unpublishing, etc. — right out of the box.
Hit Create to save and create your new content type.
Adding Fields for Your Content
The fields we select will determine the structure of all units of this content type. There are many possible fields, but we'll only be grabbing a few that reflect the content we specified up top:
Add a Title
In the list of fields on the right, find the Text field and drag it onto the content type designer
Name the field "Title"
Check Required, User Searchable, and Show in list
The third item allows the field to show up as a column in the content search tool's results
Add the Publish Date
Find the Date and Time field and drag it to the content palette
Check Required and Show in list
In the default value, type
now
— this will force the default value for the publish field to be the current date and time as of creating a new contentlet
Add Tags
Find the Tag field and drag it onto the content type designer
Select "User Searchable" to allow users to search by tags
Include some Graphics
Add either an Image field, or a Binary field onto your content type
Name the field Image
This will allow you to upload and store an image — or any other kind of asset, in the case of a Binary field — with your Article content type
Add a Body
Add a Block Editor field, as it is best suited for headless implementations
The Block Editor offers a rich text editing experience, storing content and formatting as JSON
dotCMS provides other text content controls for different use cases:
The WYSIWYG field is also a rich text editor, which stores its data as HTML
The TextArea field stores raw text
We also provide a Custom field type, which allows you to create any field or UI that you'd like and store the results in dotCMS's content.
Name the field Body
Bonus Points: Create a Custom Menu Link for Your Content
dotCMS makes it easy to add custom menu items for specific content types:
Navigate back to the List of Content Types and your new type should be displayed at the top.
Click on the three dots and select
Add to Menu
.Add the Menu item name and where on the Menu it should be shown — e.g. under "Content" — then select the default view for the content and click
Add
.
This will add a menu item under the Content Section of the left nav specifically for your articles.
Let's Go!
Congratulations! You've successfully created your first content type in dotCMS. You can now create and manage structured content efficiently using this content type. As you grow more comfortable, explore additional features and settings to further customize your dotCMS experience.