# Adding Basic Fields to a Content Type

## Goal

Add a link field and an image field to the Vendor content type.
## Prerequisite knowledge

[Concept: Content Entities and Fields](/link/691)
## Site prerequisites

The Vendor content type must exist. See [Adding a Content Type](/link/720).
## Steps

Add the fields Vendor URL and Main image to the Vendor content type.

1. In the _Manage_ administrative menu, navigate to _Structure_ > _Content
    types_ (_admin/structure/types_). Then click _Manage fields_ in the dropdown
    button for the Vendor content type. The _Manage fields_ page appears. From here
    you can either create a new field for the content type or re-use an existing
    field. Note that the names and descriptions of the content types and fields that
    were provided by your installation profile are shown in English on these pages;
    see [Concept: User Interface, Configuration, and Content translation](/link/695) for an explanation.
1. Click _Create a new field_. The _Add field_ page appears.
    ![Add field page to choose field type](https://docs.cocobook.com/uploads/images/gallery/2026-10/structure-fields-add-field.png)
1. Choose the _Link_ field type from the _Choose a field type_ options. Click _Continue_. The _Add field_ page appears with a form to configure the field label.
1. Fill in the fields as shown below.
    <table>
      <thead>
        <tr>
          <th>Field name</th>
          <th>Explanation</th>
          <th>Value</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>Label</td>
          <td>Label that is visible in administration pages</td>
          <td>Vendor URL</td>
        </tr>
        <tr>
          <td>Choose a type of field</td>
          <td>Field type</td>
          <td>Link</td>
        </tr>
      </tbody>
    </table>

    A machine name is automatically generated, based on the _Label_ value. Click
    _Edit_ if you want to override the default name.
    ![Add field page to set field label](https://docs.cocobook.com/uploads/images/gallery/2026-10/structure-fields-add-field-label.png)

1. Click _Continue. The page _Vendor URL settings for Vendor_
    appears which allows you to configure the field. Fill in the fields as shown
    below.
    <table>
      <thead>
        <tr>
          <th>Field name</th>
          <th>Explanation</th>
          <th>Value</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>Label</td>
          <td>Label that is visible in the content form</td>
          <td>Vendor URL</td>
        </tr>
        <tr>
          <td>Allowed number of values</td>
          <td>The number of values that can be entered</td>
          <td>Limited, 1</td>
        </tr>
        <tr>
          <td>Help text</td>
          <td>The instruction that is shown below the field</td>
          <td>(leave blank)</td>
        </tr>
        <tr>
          <td>Required field</td>
          <td>Whether the field is required or not</td>
          <td>Unchecked</td>
        </tr>
        <tr>
          <td>Allowed link type</td>
          <td>The kind of links that can be entered</td>
          <td>External links only</td>
        </tr>
        <tr>
          <td>Allow link text</td>
          <td>Whether a link text can be entered</td>
          <td>Disabled</td>
        </tr>
      </tbody>
    </table>

    <img src="https://docs.cocobook.com/uploads/images/gallery/2026-10/structure-fields-vendor-url.png" alt="Field settings page for Vendor URL" width="100%" />

1. Click _Save settings_. The Vendor URL has been added to the content
    type. Continue creating the Main image field.
1. Click _Create a new field_. The _Add field_ page appears.
1. Choose the _File upload_ field type from the _Choose a field type_ options. Click _Continue_. The _Add field_ page appears with a form to configure the field label.
1. Some field types require the selection of a sub-type. Fill in the fields as shown below.
    <table>
      <thead>
        <tr>
          <th>Field name</th>
          <th>Explanation</th>
          <th>Value</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>Label</td>
          <td>Label that is visible in administration pages</td>
          <td>Main image</td>
        </tr>
        <tr>
          <td>Choose an option below</td>
          <td>Field sub-type</td>
          <td>Image</td>
        </tr>
      </tbody>
    </table>
1. Click _Continue_. The page Main image settings for Vendor appears. Fill in the fields as shown below.
    <table>
      <thead>
        <tr>
          <th>Field name</th>
          <th>Explanation</th>
          <th>Value</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>Label</td>
          <td>Label that is visible in the content form</td>
          <td>Main image</td>
        </tr>
        <tr>
          <td>Allowed number of values</td>
          <td>The number of values that can be entered</td>
          <td>Limited, 1</td>
        </tr>
        <tr>
          <td>Default image</td>
          <td>You can set a default image here. This will be used when you do not provide an image when creating a Vendor content item.</td>
          <td>(leave blank)</td>
          <td>Help text</td>
          <td>The instruction that is shown below the field</td>
          <td>(leave blank)</td>
        </tr>
        <tr>
          <td>Required field</td>
          <td>Whether the field is required or not</td>
          <td>Checked</td>
        </tr>
        <tr>
          <td>Allowed file extensions</td>
          <td>The type of images that can be uploaded</td>
          <td>png, gif, jpg, jpeg</td>
        </tr>
        <tr>
          <td>File directory</td>
          <td>The directory where the files will be stored. By providing a file directory value, you ensure that all images uploaded via the Main image field will be located in the same directory.</td>
          <td>vendors</td>
        </tr>
        <tr>
          <td>Minimum image dimensions</td>
          <td>The minimum dimensions of the uploaded image</td>
          <td>600 x 600</td>
        </tr>
        <tr>
          <td>Maximum upload size</td>
          <td>The maximum file size of the uploaded image</td>
          <td>5 MB</td>
        </tr>
        <tr>
          <td>Enable Alt field</td>
          <td>Whether an alternative text can be entered</td>
          <td>Checked</td>
        </tr>
        <tr>
          <td>Alt field required</td>
          <td>Whether an alternative text is required</td>
          <td>Checked</td>
        </tr>
      </tbody>
    </table>

    <img src="https://docs.cocobook.com/uploads/images/gallery/2026-10/structure-fields-main-img.png" alt="Field settings page for Main Image" width="100%" />

1. Click _Save settings_. Main image has been added to the content type.
    <img src="https://docs.cocobook.com/uploads/images/gallery/2026-10/structure-fields-result.png" alt="Manage fields page" width="100%" />
1. Add a Main image field to the Recipe content type, using similar steps. Start
    by navigating to the Recipe content type's _Manage Fields_ page. Then use the _Re-use an existing field_ button to open the modal dialog and press the _Re-use_ button that corresponds with the Main image field in the table. Then skip to step 7 and follow the remaining steps.
    <img src="https://docs.cocobook.com/uploads/images/gallery/2026-10/structure-fields-main-img-reuse.png" alt="Select a field to re-use" width="100%" />
1. Create two Vendor content items (see [Creating a Content Item](/link/713)) called "Happy Farm"
    and "Sweet Honey". Make sure that they include images and URLs.

## Expand your understanding

* [Concept: Image Styles](/link/731)
* [Changing Content Display](/link/730)
* [Changing Content Entry Forms](/link/728)
## Videos

[Adding Basic Fields to a Content Type](https://www.youtube.com/watch?v=CZpfR9WbVcQ)

## Additional resources

[_Drupal.org_ community documentation page "Add a field to a content type"](https://www.drupal.org/docs/7/nodes-content-types-and-fields/add-a-field-to-a-content-type)
