Use the views_exclude_previous module. See below or open the module documentation for further information.
modules
05.09.2025 | Michael Ebert
Two-step deployment using Lenient Composer Plugin
redirect.install
/**
* Save the bulk delete action to config.
*/
function redirect_update_8104() {
if (!Action::load('redirect_delete_action')) {
$entity_type_manager = \Drupal::entityTypeManager();
$module_handler = \Drupal::moduleHandler();
// Save the bulk delete action to config.
$config_install_path = $module_handler->getModule('redirect')->getPath() . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY;
$storage = new FileStorage($config_install_path);
$entity_type_manager
->getStorage('action')
->create($storage->read('system.action.redirect_delete_action'))
->trustData()
->save();
}
}
13.11.2025 | Dominik Wille
Install config from config/install dir in update hook.
get_all_contrib_modules.php
<?php
/**
* Get a list of all contrib modules.
*
@param string $context
* The context of the module like contrib, custom or core.
* Only the parameter 'contrib', 'custom', or 'core' are
* available parameters.
* @return array
* Returns an array with all contrib modules' machine names.
*/
public function getAvailableModules(string $context): array {
$context = 'contrib';
$module_list = \Drupal::service('module_handler')->getModuleList();
$modules = [];
foreach ($module_list as $module) {
if (str_contains($module->getPath(), 'contrib')) {
$modules[$module->getName()] = $module;
}
}
return $modules;
}
20.06.2024 | Mathias Grab
How to get a list of all contrib modules that are installed and activated in your project
add-gitlab-ci.sh
curl https://git.drupalcode.org/project/gitlab_templates/-/raw/main/gitlab-ci/template.gitlab-ci.yml > .gitlab-ci.yml
26.03.2026 | Dominik Wille