Base Content Types - Documentation topics on: base content types,content,content types,files,forms,host content type,key value,key / value content type,pages,vanity urls,widgets,.

Base Content Types

All Content Types in dotCMS are created from Base Content Types. There are 5 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

The following table lists the Base Content Types and the purpose of each:

Base TypeDescription
Content
The Content Base Type is 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.
Widget
The Widget Base Type is 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.
File
The File Base Type allows you to create new file types which allow content contributors to upload files of particular types (or files used for particular purposes) to 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 WebDAV and/or the Content tab.
Page
The Page Base Type 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.
Persona
The Persona Base Type 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.
Key / Value
The Key/Value Base Type 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.
Vanity URL
The Vanity URL Base Type 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.

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

The Host Content Type

In addition to the 5 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 differetn 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.

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.