Prepare a Module skeleton

Last updated on
18 May 2023

In the following pages and sub-sections of the guide, we will be building using a custom module to build basic parts of a Drupal site, such as a custom page, block, entity, field, etc. All the module examples start with a module folder and a .info.yml file. With just these two things, your module will display in Drupal 8's Extend administration page, or can be installed directly using drush.

The following pages will guide you in creating the .info.yml, which will become the starting point for every new module you create.

Trying out the Hello World module

If you would like to clone the git repository of the example code contained in this section, you must have git installed and follow the Hello World module instructions. You can clone the git repository using the following command:

git clone https://github.com/aziz-712/D8HWexample.git modules/custom/hello_world

All of the files are downloaded by default but you can 'hide' them by checking out the 'skeleton' version to start with. To check it out, navigate to the module directory and use the following command:

git checkout skeleton

The rest of the branches should line up with the following sub-sections of this guide, and are designed to dovetail into their fuller counterparts in the Examples For Developers module.

Help improve this page

Page status: No known problems

You can: