Menu du compte de l'utilisateur

  • Log in

Navigation principale

  • Home Page
  • All CMS
  • Tutorials
  • White Paper
Home
Guide CMS

Breadcrumb

  • Home
  • Tutorials
  • Drupal User Guide
  • Chapter 6. Setting Up Content Structure
  • 6.3. Adding Basic Fields to a Content Type

Language selector

  • Français
  • English

Main navigation

  • Home Page
  • All CMS
  • Tutorials
  • White Paper

User login

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
  • Create new account
  • Reset your password

Book navigation

  • Tutorials
    • Drupal User Guide
      • Preface
      • Chapter 1. Understanding Drupal
      • Chapter 2. Planning Your Site
      • Chapter 3. Installation
      • Chapter 4. Basic Site Configuration
      • Chapter 5. Basic Page Management
      • Chapter 6. Setting Up Content Structure
        • 6.1. Adding a Content Type
        • 6.2. Deleting a Content Type
        • 6.3. Adding Basic Fields to a Content Type
        • 6.4. Concept: Reference Fields
        • 6.5. Concept: Taxonomy
        • 6.6. Setting Up a Taxonomy
        • 6.7. Adding a Reference Field
        • 6.8. Concept: Forms and Widgets
        • 6.9. Changing Content Entry Forms
        • 6.10. Concept: View Modes and Formatters
        • 6.11. Changing Content Display
        • 6.12. Concept: Image Styles
        • 6.13. Setting Up an Image Style
        • 6.14. Concept: Responsive Image Styles
        • 6.15. Concept: Text Formats and Editors
        • 6.16. Configuring Text Formats and Editors
      • Chapter 7. Managing User Accounts
      • Chapter 8. Blocks
      • Chapter 9. Creating Listings with Views
      • Chapter 10. Making Your Site Multilingual
      • Chapter 11. Extending and Customizing Your Site

Guy Vigneault

6.3. Adding Basic Fields to a Content Type

By Guy Vigneault | 12:16 AM EST, Mon December 15, 2025

Goal

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

Prerequisite knowledge

Section 2.3, “Concept: Content Entities and Fields”

Site prerequisites

The Vendor content type must exist. See Section 6.1, “Adding a Content Type”.

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 Section 2.7, “Concept: User Interface, Configuration, and Content translation” for an explanation.
  2. Click Create a new field. The Add field page appears.

    Add field page to choose field type

  3. 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.
  4. Fill in the fields as shown below.

    Field nameExplanationValue
    LabelLabel that is visible in administration pagesVendor URL
    Choose a type of fieldField typeLink

    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

  5. Click Continue. The page _Vendor URL settings for Vendor appears which allows you to configure the field. Fill in the fields as shown below.

    Field nameExplanationValue
    LabelLabel that is visible in the content formVendor URL
    Allowed number of valuesThe number of values that can be enteredLimited, 1
    Help textThe instruction that is shown below the field(leave blank)
    Required fieldWhether the field is required or notUnchecked
    Allowed link typeThe kind of links that can be enteredExternal links only
    Allow link textWhether a link text can be enteredDisabled

    Field settings page for Vendor URL

  6. Click Save settings. The Vendor URL has been added to the content type. Continue creating the Main image field.
  7. Click Create a new field. The Add field page appears.
  8. 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.
  9. Some field types require the selection of a sub-type. Fill in the fields as shown below.

    Field nameExplanationValue
    LabelLabel that is visible in administration pagesMain image
    Choose an option belowField sub-typeImage
  10. Click Continue. The page Main image settings for Vendor appears. Fill in the fields as shown below.

    Field nameExplanationValue
    LabelLabel that is visible in the content formMain image
    Allowed number of valuesThe number of values that can be enteredLimited, 1
    Default imageYou can set a default image here. This will be used when you do not provide an image when creating a Vendor content item.(leave blank)
    Help textThe instruction that is shown below the field(leave blank)
    Required fieldWhether the field is required or notChecked
    Allowed file extensionsThe type of images that can be uploadedpng, gif, jpg, jpeg
    File directoryThe 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.vendors
    Minimum image dimensionsThe minimum dimensions of the uploaded image600 x 600
    Maximum upload sizeThe maximum file size of the uploaded image5 MB
    Enable Alt fieldWhether an alternative text can be enteredChecked
    Alt field requiredWhether an alternative text is requiredChecked

    Field settings page for Main Image

  11. Click Save settings. Main image has been added to the content type.

    Manage fields page

  12. 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.

    Select a field to re-use

  13. Create two Vendor content items (see Section 5.2, “Creating a Content Item”) called "Happy Farm" and "Sweet Honey". Make sure that they include images and URLs.

Expand your understanding

  • Section 6.12, “Concept: Image Styles”
  • Section 6.11, “Changing Content Display”
  • Section 6.9, “Changing Content Entry Forms”

Videos

Adding Basic Fields to a Content Type

Additional resources

Drupal.org community documentation page "Add a field to a content type"

Attributions

Written by Sree Veturi and Boris Doesborg, and Joe Shindelar at Drupalize.Me.

 

Book traversal links for Tutorials

  • ‹ 6.2. Deleting a Content Type
  • Up
  • 6.4. Concept: Reference Fields ›
CMS

 

All CMS

 

Tuto

 

Tutorials

 

White Paper

 

White Paper

Powered by Drupal

Privacy Policy

Privacy Policy

 

Recent content

  • 11.4. Finding Themes
    1 day ago
  • 11.3. Downloading and Installing a Module from Drupal.org
    1 day ago
  • 11.2. Enabling and Disabling Maintenance Mode
    1 day ago
  • 11.1. Finding Modules
    1 day ago
  • Chapter 11. Extending and Customizing Your Site
    1 day ago

Copyright

Creative Commons

Sauf mention contraire, Guide CMS © 2025 par Guy Vigneault est sous licence Creative Commons Attribution - Utilisation non commerciale - Partage dans les mêmes conditions 4.0 International

 

Creative Commons

Unless otherwise stated, Guide CMS © 2025 by Guy Vigneault is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License

eGV Web