Each content item in dotCMS is an instance of a Content Type. The Content Type specifies all of the following:
- What data (in the form of fields) can be added to a content item of that Content Type.
- Which fields are required and which are optional.
- The default Permissions applied to items of the Content Type.
- The location where items of the Content Type are stored (and thus whether they inherit Permissions from the Content Type itself, or a dotCMS Site or folder).
- What Workflow Schemes can be applied to items of the Content Type.
- The default Workflow Action to perform on an item of the Content Type in operations where a Workflow Action is not specified.
- Whether or not items of the Content Type are accessible via a URL Map.
The dotCMS starter site comes with a number of Content Types created for you, and you can create your own Content Types to represent the data you wish to display on your site (such as Products, Promotions, Blog entries, etc.).
- Base Content Types
- Placing Content of a Given Content Type on a Page
- Content Type Variable Names
Base Content Types
Each Content Type is an instance of a Base Content Types (such as Files, Pages and Widgets). All Content Types of the same Base Type can be used in similar ways; for example, all Content Types created from the File Asset Base Type can be used in all ways as normal files within dotCMS. But the ability to create your own Content Types on top of the File Asset Base Type allows you to create different Content Types for different types of files - such as Documents, Images, Videos, etc. - which each have different fields, allowing you to handle and display each file type differently on your site.
Most Base Types contain (and require) certain system fields unique to that type of content. For some Base Types, it may be necessary for the system fields to be filled out to save content of any Content Type derived from that Base Type.
Every Content Type inherits the system fields from the Base Type it is created from.
Placing Content of a Given Content Type on a Page
Containers and Templates can be used to specify which Content Types will be allowed in different areas on a Page. In addition, Containers can control which fields of each Content Type will (or will not) display on the Page and how each field will be displayed when content of that Content Type is placed on a Page.
Content Type Variable Names
When you create a Content Type, it is automatically assigned a variable name, which is used to identify the Content Type in search queries, API calls, and code. The Content Type variable name is created using the Content Type name you supply, removing spaces and other punctuation, and replacing characters not supported in Velocity and Java variable names (such as double-byte characters) with alternate characters.
If the automatically generated variable name for a Content Type matches the variable name of an existing Content Type, then the variable name will automatically be made unique by appending one or more integer digits.
Changing Content Type Names
You can change the name of a Content Type at any time, but it's important to understand that the variable name for a Content Type can never be changed once it has been assigned. This is intentional, since if you were to change the variable name of the Content Type, any code, queries or other references you had already made to the Content Type variable name would no longer work.
This means that you should consider the variable name you want for a Content Type when you first create it. When you first create a Content Type, you may wish to give it a name to ensure that it is assigned a specific variable name (to simplify coding and queries, or to avoid reserved names, and then change the name afterward to a different or more friendly or human-readable name.
Reserved Variable Names
Certain variable names are reserved for Content Types, which means you can not create a Content Type with one of these variable names. If the automatically assigned variable name matches one of these reserved names, the variable name will be appended with an integer digit to prevent it from exactly matching the reserved word.
The following is a list of reserved Content Type names: