logo

Extra Block Types (EBT) - New Layout Builder experienceâť—

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

âť—Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll
14/04/2025, by Ivan

When developing custom modules, there are several scenarios where the developer is required to add a composer.json file to the module. Some of these scenarios depend on whether the custom module is intended to be shared with the community as a project on drupal.org.

If a module developer wants to use a PHP library hosted on packagist.org, they must add a composer.json file to their project.

14/04/2025, by Ivan

The content() function in the HelloController class will return markup text when the routing system calls the page.

In your module folder, you should have the standard PSR-4 folder structure /src/Controller, and inside this folder, you should have the controller file HelloController.php.
Thus, your controller file will be located at
/src/Controller/HelloController.php

You have the following code in the HelloController.php file:

13/04/2025, by Ivan

Now that we've created a placeholder for our module's settings page, let's add a menu link. The instructions below show how to create a menu link for the hello_world module under the “Development” section on the “Admin > Configuration” page (http://example.com/admin/config).

In the root folder of your module, create a new file named hello_world.links.menu.yml and add the following:

13/04/2025, by Ivan

This guide continues with the Hello World module, demonstrating how to gradually add custom blocks (and more).

If you're feeling adventurous, you can jump straight to the Examples module. The Examples module contains many more code samples used in this guide. If you're new here, keep following this tutorial and check out the Examples modules when you're ready to dive deeper.

13/04/2025, by Ivan

By adding a single YAML settings file to our module, Drupal will automatically load the contents of this YAML file, and we’ll be able to access it to provide default configuration. From the root folder of your module, create a new folder called “config.” Inside that folder, create another one named “install.” Finally, inside config/install, create a new file and name it hello_world.settings.yml.