Watch videos with subtitles in your language, upload your videos, create your own subtitles! Click here to learn more on "how to Dotsub"

Adding a Reference Field

0 (0 Likes / 0 Dislikes)
Adding a Reference Field with Amber Matz In this tutorial, we’ll walk through the process of adding a reference field. By the end of this tutorial, you will understand how to add a reference field so that recipes can be linked to the vendor, that has submitted it. To follow along, you should understand the concepts of how to add basic fields to a content type, what reference fields are and how a content type is created. Finally, the Recipe and Vendor content types must exist. See the written version of this tutorial for links to the prerequisite tutorials. In the Manage administrative menu, navigate to Structure > Content Types. This is the path admin/structure/types. Then click Manage fields in the drop-down button for the Recipe content type. The Manage fields page appears. Click Add field. We’re going to add a new field. Let’s select a field type of Reference > Content, and we’ll give it a label of Submitted by. Click Save and continue. The page Submitted by appears, which lets you set its field settings. For Type of item to reference, which is an option to select the type of referenced item, select Content, which is selected by default. For Allowed number of values, keep the default Limited and 1. Click Save field settings. The page Submitted by settings for Recipe appears, which allows you to configure the field as it exists in the Recipe content type. The Label is already populated: Submitted by. For Help text, enter Choose the vendor that submitted this recipe. Let’s make this a required field by checking the box next to Required field. We won’t specify a Default value, so, let’s move on to Reference type. For Reference method, select Default. Let’s leave unchecked Create referenced entities if they don’t already exist, because the vendor should already be created before a recipe is submitted by them. For Content types, select Vendor. For Sort by, select the sorting field Vendor name. Vendor name is the label we set as the Title field on the Vendor content type. This will sort the values we can reference alphabetically by the Vendor content type’s Title field, which we labeled Vendor name. For Sort direction, select Ascending, which will sort from A to Z. Click Save settings. The Submitted by field has been added to the content type, and a confirmation message appears. In this tutorial, we added a reference field so that recipes can be linked to the vendor that submitted it.

Video Details

Duration: 2 minutes and 54 seconds
Country: United States
Language: English
License: All rights reserved
Genre: None
Views: 2
Posted by: drupalizeme on Nov 3, 2017

Adding a Reference Field

Caption and Translate

    Sign In/Register for Dotsub to translate this video.