Component-based Development
  • Welcome!
  • What you will build
  • Chapter 1
    • Local Setup
  • Chapter 2
    • Drupal theme and Front-End Tools
  • Chapter 3
    • Components architecture
    • Best practices
    • Drupal attributes
    • Twig embeds
  • Chapter 4
    • Building Components
      • Eyebrow
      • Heading
      • Button
      • Components Variations
      • Movie Card
      • Drupal Libraries
      • Featured Movie
      • Movie Card Collection
      • Movie List
      • Other components
  • Chapter 5
    • Building the back-end
      • Taxonomy
      • Image Styles
      • Content Types
      • View
      • Paragraph Type
  • Chapter 6
    • Integrating components
      • Movie Card
      • Featured Movie
      • Movie Card Collection
      • Movie List
      • Movie full display
  • Chapter 7
    • Resources
Powered by GitBook
On this page

Was this helpful?

  1. Chapter 5
  2. Building the back-end

Content Types

In the previous set of exercises we built all the components our movie site needs. Now we are going to build the content types which will provide the data to feed the components.

Content models

Below you will see the content models for Movie and Landing Page content types. Using the step by step instructions at the bottom of this page, create both content types using the fields details outlined in the respective content model tables.

Label

Type

Machine name

Allowed # values

Synopsis

Text (formatted, long, with summary)

body

Limited 1

Cover Image

Image

field_cover_image

Limited 1

Avg. viewer rating

List (Integer)

field_average_viewer_rating

Limited 1

Genre

Entity Reference

field_genre

Unlimited

MPAA Rating

List (Text)

field_mpaa_rating

Limited 1

Promo Sentence

Text

field_promo_sentence

Limited 1

Average Viewer Rating allowed values

1|1 Star
2|2 Stars
3|3 Stars
4|4 Stars
5|5 Stars

Make 3 Stars the default value.

Genre settings

Entity to reference

Referenced type

Taxonomy term

Genre vocabulary

MPAA Rating allowed values

G|G
PG|PG
PG-13|PG-13
R|R
NC-17|NC-17

Make PG the default value.

Label

Type

Machine name

Allowed # values

Featured Movie

Entity Reference

field_featured_movie

Limited 1

Movie List

Entity Reference Revisions

field_movie_list

Unlimited

Featured Movie & Movie List settings (respectively)

Type to reference

Reference type

Content

Movie

Paragraph

Movie Genre List

PreviousImage StylesNextView

Last updated 6 years ago

Was this helpful?