Installing a module in Drupal 9

By gnanaguru, 9 August, 2022

You can add new features to websites by adding modules to Drupal website

There are two ways to add modules into websites

  1. Adding a module using composer
  2. Adding a module using drush

Note: After adding module to website, you needed to enable the module using drupal interface or using drush commands

Adding a module using composer

*) Open the command prompt or terminal and located into Drupal installed root path

*) run the following commands

$ compser require drupal/[module_name]

Example:

$ composer require 'drupal/paragraphs:^1.14'

Adding a module using drush

*) Open the command prompt or terminal and located into Drupal installed root path

*) run the following command

drush dl [module_name]

Example:

drush dl paragraphs

*) run the following commands to enable the module

drush en [module_name]

Example:

drush en paragraphs

Tags

Comments

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.