Advanced Components
  • Welcome
  • Start here
    • Setup
    • Dependencies
  • Getting Started
    • Front-end tooling
    • Create a new D9 theme
    • Component Architecture
    • Drupal Best Practices
    • Drupal Attributes
    • Twig Blocks
  • Basic Components
    • Global styles
    • Adding webfonts
    • Heading Component
      • Improving the Heading
    • Button Component
  • A component's lifecycle
    • Hero Component
    • Include statements
    • Drupal prep
    • Drupal entities
    • Homepage content type
    • View modes
    • Add Hero to homepage
    • Drupal cache & twig debugging
    • Twig template suggestions
    • Getting field values
    • Integrating the Hero
    • Drupal Libraries
    • Hero Image styles
  • Card component
    • Card Component
    • Component Variants
    • Card Variant
    • Author component
  • Drupal site building
    • Blog articles
    • View modes
    • Drupal Views
    • Author
    • Generate content
    • Adding Blog Lists to the Homepage
  • Drupal Integrations
    • Integrating the Card
      • Taxonomy terms
    • Integrating the Card Wide
    • Author integration
    • From our blog
    • Integrating From our blog
    • Featured Content
    • Integrating Featured Content
    • Blog image styles
    • Blog detail page
  • Extras
    • Image Styles
    • Navigation
  • Resources
    • Resources
Powered by GitBook
On this page

Was this helpful?

  1. Drupal site building

Blog articles

We'll modify Drupal core's Article content type so we can use it to generate blog post for our site. Blog articles are the content we will display on the homepage as Featured Content and From our Blog. This means each card in the homepage represents a blog article in a compact view. We will achieve the Card and Card Wide displays using Drupal's View Modes.

  1. From Drupal's Admin Toolbar, click Structure | Content Types

  2. Click Manage fields next to Article

  3. Delete the **Comments **field

  4. Add the missing fields based on the table below

  5. Click the Save and manage fields button at the bottom of the page

Add the following fields:

Field label
Machine name
Field type

Title

label

This field is auto generated. No need to create it

Body

body

This field is auto generated. No need to create it

Date

date

This field is auto generated. No need to create it

Image

field_image

Media Reference

Tags

field_tags

Taxonomy Term Reference

Author

field_author

User Reference

Category

field_category

Text (plain)

For the Author field, set the following configuration:

  • Allowed number of values is 1

  • Reference type deselect Include the anonymous user

PreviousAuthor componentNextView modes

Last updated 3 years ago

Was this helpful?