Base Content Types

Last Updated: Nov 1, 2024
documentation for the dotCMS Content Management System

All Content Types in dotCMS are created from Base Content Types. There are nine different Base Content Types in dotCMS. All custom Content Types you create must be created from one of the Base Content Types, and each custom Content Type inherits all the fields contained in the Base Type (as well as any custom fields you add to your Content Type).

The Base Content Types

You can identify the Base Content Type of an existing Content Type by viewing the Type field in the Content Type Properties tab.

When accessed via Lucene query, Base Content Types are fetched through an integer value:

IndexType
0Any
1Content
2Widget
3Form
4File Asset
5Page
6Persona
7Vanity URL
8Key/Value
9dotAsset

Common Base Types: Content, Page, Widget, and Form

Base TypeDescriptionDetails
Content
Used to create standard Content Types that do not represent any pre-defined type of content, and do not contain any pre-defined system fields.
  • It is recommended that you use the Content Base Type for all new Content Types you create, unless you have a specific need for one of the other Base Types.
Page
Allows you to create different Content Types for different types of Pages on your site.
  • The default dotCMS installation includes a Page Asset Content Type that has all the basic system fields needed to create a page
  • In addition, you may create custom Page Content Types that have custom properties or behaviors.
Widget
Used to create a Widget Content Type, which allows you to create a number of different Widgets (instances of the Widget Content Type) which all share the same core code, but differ in the values of specific parameters that you create in the Widget Content Type.
  • Once you've created a Widget Content Type, content creators can create different versions of your Widget Content Type, each of which uses different values of the Widget parameters.
  • Widget Content Types are intended to be built by web developers and used by content contributors
    • this enables content contributors to add advanced functionality to their pages without requiring coding experience.
Form
Used to build reusable, dynamic forms within dotCMS to embed on any page.
  • The Form Builder allows the creation of forms without the use of HTML or Velocity.
  • Form submissions are stored as content capable of dynamic access or display.
  • Specify email addresses to receive notifications on form submission.
  • As with Widgets, underlying Form code is not exposed to content contributors.

File Base Types: Asset and File

There are two different Base Types that you can use to upload and manage files. The Asset Base Type allows you to create files which exist within the dotCMS content store, but which do not have a normal URL path. The File Base Type allows you to create files which have a specific location within the dotCMS site and folder tree, and which can be accessed with a URL that references the file's location in the file tree.

Base TypeDescriptionDetails
dotAsset
Allows you to create files and images which are stored within dotCMS, but which do not have a standard URL path to them based on the file and folder tree in the Site Browser.
  • Files may be uploaded to dotCMS using a dotAsset Content Type without specifying a specific folder for the file.
  • Files created using a dotAsset Content Type are not displayed in the Site Browser, but may be accessed using the Content Search screen.
  • You may upload files without specifying a Content Type for the uploaded file, and when this happens a dotAsset Content Type will automatically be selected for the file, based on the file extension, and the value of the accept Field Variable in the Binary fields of all dotAsset Content Types on your site.
File
Allows you to create new file types which allow content contributors to upload files of particular types (or files used for particular purposes) to specific locations on your site.
  • The default dotCMS installation includes a File Asset Content Type that has all the basic system fields needed to create a file.
  • In addition, different File Content Types can be created to represent different types of files, and fields can be added to each File Content Type to add to the information stored for each file of that type.
    • For example, a Video Content Type might require additional Thumbnail, Screenshot, or Length fields, whereas a Document Content Type might require Number of Pages, Department, and Author fields.
  • Files (e.g. individual content items of File Content Types) can be referenced and managed via the Site Browser, as well as via dotCLI and/or the Content tab.

Special Purpose Base Types: Key/Value, Persona, and Vanity URL

The following Base Types have custom behavior which allows you to create multiple different Content Types which take advantage of important dotCMS features, such as Vanity URLs and Personalization.

Base TypeDescriptionDetails
Key / Value
Allows you to create different Content Types which associate specific values to specific keys.
  • dotCMS Language Variables are implemented using the Key/Value Content Type, and allow you to create specific keys which can contain different values in each language your site supports so that you may have a single page or piece of content which automatically display appropriate values depending on the visitor's chosen language.
  • In addition, you may create custom Key/Value Content Types that have custom properties or behaviors.
Persona
Allows you to create new Persona Content Types for different classes of users that use your site.
  • The default dotCMS installation includes a Persona Content Type that has all the basic system fields needed to create a Persona.
  • In additon, you may create custom Persona Content Types that contain custom fields which differ from the Persona Base Type.
    • For example, if your web site has different classes of users (such as End-Users, Partners, and Internal Users), you can create a separate Persona Content Type for each class of user, with appropriate fields for each user class (such as “Product Family” for Partners, “Department” for Internal Users, etc.).
    • You can then create multiple individual Personas within each class of users, with each individual Persona specifying the information appropriate to the class of user (Persona Content Type) the Persona was created from.
    • All individual Personas will still be accessible normally (via both the back-end and code), but different information will be available in the Persona depending on which Persona Content Type was used to create it.
Vanity URL
Allows you to create multiple Vanity URL Content Types, with additional fields that extend Vanity URLs.
  • Vanity URLs enable you to create multiple URLs on your site that forward visitors to the same page or file.
  • Since Vanity URLs are content, you may extend the default Vanity URL content type to add and use new fields.
  • In addition, you may create additional Vanity URL Content Types with different fields and uses.
  • dotCMS automatically forwards all Vanity URLs based on the values in the Vanity URL base type system fields, no matter how many Vanity URL Content Types you have.

The Host Content Type

In addition to the nine Base Content Types described above, there is also a Host Content Type, which is used to store information on all the sites hosted on your dotCMS instance. But unlike the Base Content Types above, you can not create your own custom Content Type from the Host Content Type. However you can extend the Host Content Type by adding any fields you wish to it; this allows you to add information which your users can (or must) supply for each site hosted on your dotCMS instance.

For example, you may wish to change or add fields that represent developer keys for different Web APIs used by your sites (such as Google Analytics). You can then write a single Widget or other code block that can appropriately access Web APIs on all your sites, but pull the appropriate developer key based on the site the code is run on.

Custom “Base” Content Types

dotCMS includes the ability to copy a Content Type. In practice, this means that user-created Content Types can function similarly to a Base Content Type, as one can act as a template or prototype for another. However, they will not be enumerated in the same way as a system base type, and so cannot be fetched via the +baseType: Lucene query argument.

See the page on Copying a Content Type for more information.

Content Type Fields

Content can be thought of very much like a data in a database. Each Content Type can be thought of as similar to a table in a database, where the fields of the Content Type represent the columns of the table and each individual content item represents a row in the table.

The fields in a Content Type (e.g. “columns” in the “table”) of each Content Type are comprised of the Standard Field Types, the WYSIWYG Field, Tag and Category Fields, etc. Nearly all fields can be made searchable, and can be accessed via the RESTful APIs. For more information, please see the Content Type Fields documentation section.

System Fields

Each Base Content Type contains a number of system fields, which are fields that exist in all content types of the same Base Type. When you create a new custom Content Type, you may add new fields and you may change the values of the system fields, but you may not remove the system fields that come from the Base Type.

Most system fields are intended for your content contributors to fill in; these represent information which is required for all content of a given Base Type (such as the “Host or Folder” and “Show on Menu” fields for the File Base Type, or the “Title” and “URL” fields for the Page Base Type). However some Base Content Types contain system fields which are intended only for your web developers to edit (such as the “Code” field on the Widget Base Type).

Which system fields are available to your content contributors depends on the Base Content Type and the system field, however:

  • You can identify the system fields in any Content Type by viewing the Action column in the Content Type Fields tab.
    • Any field which can not be removed (i.e. any field which does not have a red X in the Action column) is a system field which is part of the Base Content Type.
  • You can identify which system fields are available for your content contributors to edit by viewing the Content editing screen for an individual Content item of the given Content Type.
    • Any system field which is visible and editable in the Content editing screen is available (and intended) for your content contributors to edit.
    • Any system field which is not visible in the Content editing screen is intended for your web developers to edit.
    • Any system field which is visible in the Content editing screen but not editable is not intended for either your web developers or content contributors to edit; these fields are automatically filled in by dotCMS based on the values entered in other system fields.

On this page

×

We Dig Feedback

Selected excerpt:

×