Last updated May 8, 2018


Goal

Add a reference field so that recipes can be linked to the vendor that has submitted it.

Site prerequisites

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

Steps

Adding a Reference Field

  1. In the Manage administrative menu, navigate to Structure > Content types (admin/structure/types). Then click Manage fields in the dropdown button for the Recipe content type. The Manage fields page appears.
  2. Click Add field. The Add field page appears. Fill in the fields as shown below. Click Save and continue.

    Field name Explanation Value

    Add a new field

    Option to specify the field type

    Reference > Content

    Label

    The title you want to give the field

    Submitted by

    Adding a reference field to a content type

  3. The page Submitted by appears which lets you set the allowed number of values. Fill in the fields as shown below. Click Save field settings.

    Field name Explanation Value

    Type of item to reference

    Option to select the type of referenced item

    Content

    Allowed number of values

    Specify the count of values associated with the field

    Limited, 1

    Storage configuration of a reference field

  4. The page Submitted by settings for Recipe appears which allows you to configure the field. Fill in the fields as shown below. Click Save settings.

    Field name Explanation Value

    Label

    Title shown for this field on the page

    Submitted by

    Help text

    Brief text aiding the person creating content

    Choose the vendor that submitted this recipe

    Required field

    Whether a value has to be provided or not

    Checked

    Reference type > Reference method

    Option to select reference method

    Default

    Reference type > Content types

    Specify the content type

    Vendor

    Reference type > Sort by

    Sorting field

    Title

    Reference type > Sort direction

    Sorting order

    Ascending

    Settings for a reference field

  5. The Submitted by field has been added to the content type.

    Manage fields page for the Recipe content type