Skip to content

Content-Type

Let's create our first content type.

Imagine we want to build a small tool, which helps a company to store their upcoming and past events.

First we need to create a "content type". You can compare it to a model or database table, which stores your information.

Strapi creates and alters your table in the database automatically, so we just have to setup the content type through the UI.

Click on the left side on Content-Types Builder and then on Create new collection type:

Then we enter the name of the new content type Event for example:

We click on Continue and add a new Textfield to the model:

After that we enter "name" as name for the field and check the Advanded Settings, where we check required field.

Now we do that for description (optional Textfield), start (required DateTimefield), end (required DateTimefield).

After we created the fields we should see this model.

We press Save to let Strapi create the tables in the database.

On the left side under Collection Types should appear Events.

We click on Events and then on Add New Event:

Enter data for a new event and click on Save: