18.11.2015 Views

Beginning Drupal 8

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 20 ■ Building a Company Site<br />

To create the new content type, return to the “Content types” page and click the “Add content type”<br />

button. Follow the steps that were outlined in Chapter 5 to create the fields. When creating the entity<br />

reference field for Types of Services, select Views as the Type of item to reference and create a new view that<br />

lists all articles that have the taxonomy term of Service Offering. This will provide you with a list of service<br />

offerings to select from. You may create the view before starting the creation of the content type by following<br />

the steps outlined in Chapter 9. The difference in this view as compared to what we created in Chapter 9<br />

is that the display type is Entity Reference and the Settings for the Entity Reference List format requires<br />

that you pick a field that the editor will use to search for content to connect to the article they are writing.<br />

I’ll use the standard title field and update the label for that field to Project Title. The view that supports the<br />

requirements is as shown in Figure 20-4.<br />

Figure 20-4. Entity Reference view for Service Offering<br />

After creating the view, we can now add the entity reference field to the Client Portfolio content type.<br />

Figure 20-5 demonstrates setting the Reference Type fields to Views and assigning the Service Offerings view<br />

as the source of the content to be reference.<br />

215

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!