Reader small image

You're reading from  Modernizing Drupal 10 Theme Development

Product typeBook
Published inAug 2023
PublisherPackt
ISBN-139781803238098
Edition1st Edition
Concepts
Right arrow
Author (1)
Luca Lusso
Luca Lusso
author image
Luca Lusso

Luca Lusso is a Drupal developer with more than 15 years experience, he started with Drupal 5 and PHP 5 in an era where deployments with FTP were still a thing. Since then, he worked as a consultant and contributed to build some of the biggest Drupal websites in Italy. Luca is also a teacher and he has taught Drupal to a lot of different teams, from universities to big system integrators. Luca is an open source lover and Drupal contributor, he maintains some popular modules like WebProfiler and Monolog. He's also a speaker in conferences like DrupalCon Europe and Drupal Developer Days. Lately, he has shifted his interest towards frontend performances. Luca holds a master's degree in Computer Science and he's an Acquia certified developer.
Read more about Luca Lusso

Right arrow

How to create a component with SDC

SDC is a directory with some files inside. You can create everything you need by hand or leverage a Drush command provided by the Component Libraries: Generator (cl_generator, https://www.drupal.org/project/cl_generator) contributed module.

Note

At the time of writing, there are two versions of the cl_generator module – be sure to install version 2, which is compatible with SDC from Drupal core. There are also plans to move the generator directly inside Drush; look at the project page at drupal.org to check for the latest on this.

Open a terminal and type the following command to start the generation wizard:

ddev drush generate theme:sdc:component

Work through the questions and provide answers to generate a component with these values:

  • Location: theme
  • Machine name of the theme: alps_trips
  • Components directory: components (the default, and with SDC, the only valid value)
  • Component machine name: at-button
  • ...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Modernizing Drupal 10 Theme Development
Published in: Aug 2023Publisher: PacktISBN-13: 9781803238098

Author (1)

author image
Luca Lusso

Luca Lusso is a Drupal developer with more than 15 years experience, he started with Drupal 5 and PHP 5 in an era where deployments with FTP were still a thing. Since then, he worked as a consultant and contributed to build some of the biggest Drupal websites in Italy. Luca is also a teacher and he has taught Drupal to a lot of different teams, from universities to big system integrators. Luca is an open source lover and Drupal contributor, he maintains some popular modules like WebProfiler and Monolog. He's also a speaker in conferences like DrupalCon Europe and Drupal Developer Days. Lately, he has shifted his interest towards frontend performances. Luca holds a master's degree in Computer Science and he's an Acquia certified developer.
Read more about Luca Lusso