Planet Drupal

Subscribe to Planet Drupal feed
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 4 hours 21 min ago

DrupalEasy: Using ECA to pre-populate a form field from a query string variable

Thu, 2024-08-08 10:06

There's no doubt that the ECA module is changing the way Drupal sites are built  - at least for those of us that use it regularly. I recently used it to pre-populate a form field on a node add page and it turned out to be easier than I figured it would be.

The task was to pass the value I wanted to pre-populate into the form via a query string variable. Something like:

https://mysite.ddev.site/node/add/article?myvalue=1

On the node add page, there exists an entity reference field whose value I'd like to pre populate with a value of 1 (myvalue). 

Modules required

Modules used in the following solution are:

  • Token
  • BPMN.iO for ECA
  • ECA BPMN (part of ECA module)
  • ECA Form (part of ECA module)
  • ECA UI (part of ECA module)
  • ECA Core (part of ECA module)

The Token module is required because the ECA model will access the myvalue query string value via a token. 

ECA components

The ECA Form module (a sub-module of ECA) provides the necessary components to achieve the goal. 

The Build Form event and the Form Field: Set Default Value task components are all that are needed. Configuration as follows:

Build Form event

  • Restrict by form id: node-article-form
  • Restrict by entity type ID: node
  • Restrict by entity bundle: article

Form Field: Set Default Value task 

  • Field name: field_linked_content
  • Value: [current-page:query:myvalue]
     

Once the model is created and saved, enjoy the fruits of your labor!

Other potential solutions

Was ECA the only way to complete this task? Certainly not. A small custom module could be written to achieve the same goal. In addition, there's the Pre-populate and Entity prepopulate modules.

Why use an ECA-based solution then? If you're already using ECA on the project for something else, then I'd recommend this type of ECA solution in order to avoid adding an additional contrib module just for your pre-populating needs.
 

Categories: FLOSS Project Planets

The Drop Times: Drupal Site Outage Resolved After Brief Downtime

Thu, 2024-08-08 08:18
The Drupal website experienced a brief outage, but the issue has been resolved by the team. Fran Garcia Linares provided updates during the downtime, assuring users that the team was working on restoring services.
Categories: FLOSS Project Planets

ThinkDrop Consulting: Presenting "Self-hosted DDEV on GitHub Actions" by Jon Pugh at DrupalGovCon 2024

Thu, 2024-08-08 07:18
Presenting "Self-hosted DDEV on GitHub Actions" by Jon Pugh at DrupalGovCon 2024 Jon Pugh Thu, 08/08/2024 - 07:18

Next week I'm headed to DrupalGovCon 2024 to present on a brand new technique I created for hosting fast and reliable preview/test environments using DDEV and GitHub Actions.

DDEV supports what they call "Casual Hosting". With the right config tweaks, you can run multiple DDEV sites on a server for hosting sites on the internet.

Categories: FLOSS Project Planets

The Drop Times: A Closer Look at FFW's Transition to JAKALA

Thu, 2024-08-08 06:13
JAKALA, the leading data and AI-driven portfolio company of Ardian Buyout has acquired FFW, a key player in digital experience solutions. This acquisition, the largest non-publicly traded digital agency deal in Europe for 2023, expands JAKALA's global footprint and service offerings, pushing its workforce to over 3,000 professionals and turnover beyond €500 million. The merger aims to enhance client experiences through combined expertise in data, technology, and AI.
Categories: FLOSS Project Planets

Smartbees: Drupal vs. Adobe Experience Manager: Platforms Comparison

Thu, 2024-08-08 04:26

Drupal and AEM are two popular content management systems used by many companies. They offer advanced features for creating, editing, and publishing content but differ in many ways. In this article, we will compare Drupal to AEM to help you find the right CMS for your needs.

Categories: FLOSS Project Planets

The Drop Times: Introducing Dresktop: Multi-Platform Tool for Drupal Project Management

Wed, 2024-08-07 09:57
Jose Daniel Estrada's new application, Dresktop, simplifies Drupal project management with multi-platform support, Docker integration, and robust tools for deployment and updates. Available on MacOS, Windows (soon), and Linux, Dresktop is a free, open-source solution for developers.
Categories: FLOSS Project Planets

Lullabot: Drupal 11: What’s New and What’s Next

Wed, 2024-08-07 09:51

Drupal 11 was released on August 2nd, 2024. A lot has changed since Drupal 10, and a lot of preliminary work has been done that will help with Drupal Starshot. Besides improvements made to CKEditor integration, a revamp of the Field UI, performance improvements, and revisions for taxonomy terms, several big changes have been included to help the ambitious site builder.

Categories: FLOSS Project Planets

Tag1 Consulting: Migrating Your Data from D7 to D10: Migrating taxonomy vocabularies and D7 field collections into D10 paragraphs

Wed, 2024-08-07 09:50

In the previous article, we began migrating configuration from Drupal 7 example site to our Drupal 10 instance, specifically content types. In today's article, we will continue with two more D7 entities: taxonomy vocabularies and field collections. The latter will be imported as Paragraphs in Drupal 10. Along the way, we will review the content model and the migration plan. This will help us determine what parts of the migration should be automated and what can be performed manually.

Read more mauricio Wed, 08/07/2024 - 06:50
Categories: FLOSS Project Planets

Drupal life hack's: Extended Review of Backward Compatibility Questions When Upgrading to Drupal 11

Wed, 2024-08-07 09:11
Extended Review of Backward Compatibility Questions When Upgrading to Drupal 11 admin Wed, 08/07/2024 - 16:11
Categories: FLOSS Project Planets

Drupal Starshot blog: Introducing Drupal Starshot's product strategy

Wed, 2024-08-07 09:10

This blog has been re-posted and edited with permission from Dries Buytaert's blog.

Drupal Starshot aims to attract mid-market marketers by offering out-of-the-box marketing best practices, user-friendly tools, AI-driven site building features, all while maintaining the many advantages of Drupal Core.

I'm excited to share the first version of Drupal Starshot's product strategy, a document that aims to guide the development and marketing of Drupal Starshot. To read it, download the full Drupal Starshot strategy document as a PDF (8 MB).

This strategy document is the result of a collaborative effort among the Drupal Starshot leadership team, the Drupal Starshot Advisory Council, and the Drupal Core Committers. We also tested it with marketers who provided feedback and validation.

Drupal Starshot and Drupal Core

Drupal Starshot is the temporary name for an initiative that extends the capabilities of Drupal Core. Drupal Starshot aims to broaden Drupal's appeal to marketers and a wider range of project budgets. Our ultimate goal is to increase Drupal's adoption, solidify Drupal's position as a leading CMS, and champion an Open Web.

For more context, please watch my DrupalCon Portland keynote.

It's important to note that Drupal Starshot and Drupal Core will have separate, yet complementary, product strategies. Drupal Starshot will focus on empowering marketers and expanding Drupal's presence in the mid-market, while Drupal Core will prioritize the needs of developers and more technical users. I'll write more about the Drupal Core product strategy in a future blog post once we have finalized it. Together, these two strategies will form a comprehensive vision for Drupal as a product.

Why a product strategy?

By defining our goals, target audience and necessary features, we can more effectively guide contributors and ensure that everyone is working towards a common vision. This product strategy will serve as a foundation for our development roadmap, our marketing efforts, enabling Drupal Certified Partners, and more.

Drupal Starshot product strategy TL;DR

For the detailed product strategy, please read the full Drupal Starshot strategy document (8 MB, PDF). Below is a summary.

Drupal Starshot aims to be the gold standard for marketers that want to build great digital experiences.

We'd like to expand Drupal's reach by focusing on two strategic shifts:

  1. Prioritizing Drupal for content creators, marketers, web managers, and web designers so they can independently build websites. A key goal is to empower these marketing professionals to build and manage their websites independently without relying on developers or having to use the command line or an IDE.
  2. Extending Drupal's presence in the mid-market segment, targeting projects with total budgets between $30,000 and $120,000 USD (€25,000 to €100,000).

Drupal Starshot will differentiate itself from competitors by providing:

  1. A thoughtfully designed platform for marketers, balancing ease of use with flexibility. It includes smart defaults, best practices for common marketing tasks, marketing-focused editorial tools, and helpful learning resources.
  2. A growth-oriented approach. Start simple with Drupal Starshot's user-friendly tools, and unlock advanced features as your site grows or you gain expertise. With sophisticated content modeling, efficient content reuse across channels, and robust integrations with other leading marketing technologies, ambitious marketers won't face the limitations of other CMSs and will have the flexibility to scale their site as needed.
  3. AI-assisted site building tools to simplify complex tasks, making Drupal accessible to a wider range of users.
  4. Drupal's existing competitive advantages such as extensibility, scalability, security, accessibility, multilingual support, and more.
What about ambitious site builders?

In the past, we used the term ambitious site builders to describe Drupal's target audience. Although this term doesn't appear in the product strategy document, it remains relevant.

While the strategy document is publicly available, it is primarily an internal guide. It outlines our plans but doesn't dictate our marketing language. Our product strategy's language purposly aligns with terms used by our target users, based on persona research and interviews.

To me, "ambitious site builders" includes all Drupal users, from those working with Drupal Core (more technically skilled) to those working with Drupal Starshot (less technical). Both groups are ambitious, with Drupal Starshot specifically targeting "ambitious marketers" or "ambitious no-code developers".

Give feedback

The product strategy is a living document, and we value input. We invite you to share your thoughts, suggestions, and questions in the product strategy feedback issue within the Drupal Starshot issue queue.

Get involved

There are many opportunities to get involved with Drupal Starshot, whether you're a marketer, developer, designer, writer, project manager, or simply passionate about the future of Drupal. To learn more about how you can contribute to Drupal Starshot, visit https://drupal.org/starshot.

Thank you

I'd like to thank the Drupal Starshot leadership team, the Drupal Starshot Advisory Council, and the Drupal Core Committers for their input on the strategy. I'm also grateful for the marketers who provided feedback on our strategy, helping us refine our approach.

File attachments:  starshot-strategy-1920w.jpg
Categories: FLOSS Project Planets

mark.ie: Sponsorship slot available for Drupal contribution credits

Wed, 2024-08-07 05:49

I have a small window of time available if you'd like to get credits for sponsoring Drupal contributions.

Categories: FLOSS Project Planets

roose.digital: Let your Drupal website perform actions without the need for programming

Wed, 2024-08-07 05:29
With the help of the ECA module, you, as a non-programmer, can have your Drupal website perform actions based on predefined rules. For example, sending an email when someone posts a comment.
Categories: FLOSS Project Planets

Drupal.org blog: The Bounty program: Starshot edition

Wed, 2024-08-07 04:10

With all the news and activities happening around Starshot, you may have missed this, but the Drupal Association has launched the Starshot Contribution Credits. This consists of credits granted to a series contributions, in particular:

  • contributions to any modules, themes, etc that are designated as part of Starshot, 

  • 50 credits per week for each FTE (full time employee) equivalent dedicated to starshot, 

  • 1 credit per $100 invested for financial contributions and finally,

  • Special credit bounties for individual issues of exceptional importance.

You can read more about the contribution bonuses https://www.drupal.org/about/starshot/contribution-credit

The last point, special credit bounties, opens the door to a contribution coming from the Bounty Program.

What are we trying to do?

Given the success of the previous phase, we thought it was the moment to announce a few new issues that would carry extra credits, supporting the Starshot initiative. These issues are targeted at improvements to Drupal core that would reduce the number of contrib modules required in Starshot.

These are the issues that the period involved have identified:

And, as in the previous edition, the reward will be 50 credits for contributing to resolving these issues (5x the standard credit amount). Sounds good?

While these issues are not good candidates for a user or organization's first time contribution, they are a great opportunity for more senior contributors to have an impact.

Special thanks to: Tim Lehnen, Pamela Barone, Gábor Hojtsy, Nathaniel Catchpole and everyone that I am missing in and out of the core team for their help and support in identifying candidate issues for these bounties.
 

Note: What is the Bounty program?

The Bounty program started as a proof of concept to validate that we can help align the goals of the Drupal Association and Drupal itself, with the goals of individuals, companies, and the rest of the community, and hence, accelerate Drupal Innovation.

You may remember that this started during my tenure with the Drupal Association, and although my contract and direct involvement reached to an end at the beginning of the year, I committed myself, even before I left, to continuing the work I started with the Drupal Association, but especially with Drupal as a project, and the community. That’s why I’m still committed to helping run and coordinating this and other innovation programs, and that’s why I’m running as well for the Board of Directors (more on this soon).

Categories: FLOSS Project Planets

Drupal.org blog: Updated window for Drupal.org login flow deployment

Tue, 2024-08-06 20:37

The Drupal Association engineering team is preparing to switch over to our new single sign-on solution for user login. This is an important step in our work to upgrade Drupal.org, and in the future will give you the ability to use your Drupal.org identity in new ways. 

This switchover was previously scheduled for Thursday, 25 July, but unfortunately we had to roll-back that attempt. After pausing for a week to avoid disrupting the Drupal 11 release window, we are ready to try again.

The switch-over is scheduled for:

  • Thursday 8 August - from 9am to 1pm Pacific (16:00-20:00 UTC).

During this window you will not be able to update your Drupal.org profile, and during portions of this window you may not be able to login to Drupal.org, and may not be able to access related services which use your Drupal identity, such as git.drupalcode.org.

Below you'll find the details from our original blog post about how the login experience will look different: 

If you are an existing user

When you click to login or create an account you will be redirected to: accounts.drupal.org 

You will log in with your existing Drupal.org username or email and your current password, and your two factor authentication code if you have TFA enabled.

Once you log in, you will have to change your password.

If you have Two Factor Authentication enabled, you will also have to set up a new seed.

After that, you'll be taken back to Drupal.org as normal. You should be directed back to the path you came from.

If you are creating a new account

When you click 'create account' on Drupal.org you will be taken to the new account creation page: 

After you complete the basic information,  you will be taken to the Drupal.org welcome page to fill out the rest of your user profile.

If you need to change your account information

The majority of your account information will continue to live in your Drupal.org profile, however, some basic account information will now be stored and updated in the Drupal.org SSO system.

When you click to edit your first and last name, username, password, email address, or enable two factor authentication you'll be taken to the account page:

Setting up Two Factor Authentication

This account settings page is also where you can change your Two Factor Authentication settings. You can use the 'Account Security' tab in the sidebar to navigate to the Two Factor setup process:

If you need to reset your password

If you have forgotten your password, you can reset your password from the login page:

You will receive a password reset email from noreply@drupal.org allowing you to change your password.

If you encounter any issues with your account, please contact us at help@drupal.org

We want to thank two of our partners for supporting this project.

Cloud-IAM is our SSO partner. Cloud-IAM is a privacy centric provider of hosted solutions for Keycloak, an open source identity management service. They are enthusiastic supporters of the Drupal community, and would like to offer any site owners and agencies who are looking for their own identity and access management service 10% off, with promo code: DRUPAL10.

Our implementation partner on this project was Tag1Consulting. Tag1Consulting is a global team of Drupal experts working with clients from non-profits to the Fortune 500, and is one of the top contributors to Drupal. They have been the Drupal Association's infrastructure partner for many years. 

Categories: FLOSS Project Planets

ImageX: Exploring the Drupal 11 Release: New Features and Major Enhancements

Tue, 2024-08-06 18:50

Authored by Nadiia Nykolaichuk.

Drupal 11.0.0 has been successfully released as a new major Drupal version which is very exciting news for everyone using Drupal or thinking about making the switch! This flexible, accessible, powerful, integration-ready, and secure CMS has transformed even more on the way from Drupal 10 to Drupal 11

Categories: FLOSS Project Planets

Dries Buytaert: Introducing Drupal Starshot's product strategy

Tue, 2024-08-06 18:49

I'm excited to share the first version of Drupal Starshot's product strategy, a document that aims to guide the development and marketing of Drupal Starshot. To read it, download the full Drupal Starshot strategy document as a PDF (8 MB).

This strategy document is the result of a collaborative effort among the Drupal Starshot leadership team, the Drupal Starshot Advisory Council, and the Drupal Core Committers. We also tested it with marketers who provided feedback and validation.

Drupal Starshot and Drupal Core

Drupal Starshot is the temporary codename for an initiative that extends the capabilities of Drupal Core. Drupal Starshot aims to broaden Drupal's appeal to marketers and a wider range of project budgets. Our ultimate goal is to increase Drupal's adoption, solidify Drupal's position as a leading CMS, and champion an Open Web.

For more context, please watch my DrupalCon Portland keynote.

It's important to note that Drupal Starshot and Drupal Core will have separate yet complementary product strategies. Drupal Starshot will focus on empowering marketers and expanding Drupal's presence in the mid-market, while Drupal Core will prioritize the needs of developers and more technical users. I'll write more about the Drupal Core product strategy in a future blog post once we have finalized it. Together, these two strategies will form a comprehensive vision for Drupal as a product.

Why a product strategy?

By defining our goals, target audience and necessary features, we can more effectively guide contributors and ensure that everyone is working towards a common vision. This product strategy will serve as a foundation for our development roadmap, our marketing efforts, enabling Drupal Certified Partners, and more.

Drupal Starshot product strategy TL;DR

For the detailed product strategy, please read the full Drupal Starshot strategy document (8 MB, PDF). Below is just a summary.

Drupal Starshot aims to be the gold standard for marketers that want to build great digital experiences.

We'd like to expand Drupal's reach by focusing on two strategic shifts:

  1. Prioritizing Drupal for content creators, marketers, web managers, and web designers so they can independently build websites. A key goal is to empower these marketing professionals to build and manage their websites independently without relying on developers or having to use the command line or an IDE.
  2. Extending Drupal's presence in the mid-market segment, targeting projects with total budgets between $30,000 and $120,000 USD (€25,000 to €100,000).

Drupal Starshot will differentiate itself from competitors by providing:

  1. A thoughtfully designed platform for marketers, balancing ease of use with flexibility. It includes smart defaults, best practices for common marketing tasks, marketing-focused editorial tools, and helpful learning resources.
  2. A growth-oriented approach. Start simple with Drupal Starshot's user-friendly tools, and unlock advanced features as your site grows or you gain expertise. With sophisticated content modeling, efficient content reuse across channels, and robust integrations with other leading marketing technologies, ambitious marketers won't face the limitations of other CMSs and will have the flexibility to scale their site as needed.
  3. AI-assisted site building tools to simplify complex tasks, making Drupal accessible to a wider range of users.
  4. Drupal's existing competitive advantages such as extensibility, scalability, security, accessibility, multilingual support, and more.
Give feedback

The product strategy is a living document, and we value input. We invite you to share your thoughts, suggestions, and questions in the product strategy feedback issue within the Drupal Starshot issue queue.

Get involved

There are many opportunities to get involved with Drupal Starshot, whether you're a marketer, developer, designer, writer, project manager, or simply passionate about the future of Drupal. To learn more about how you can contribute to Drupal Starshot, visit https://drupal.org/starshot.

Thank you

I'd like to thank the Drupal Starshot leadership team, the Drupal Starshot Advisory Council, and the Drupal Core Committers for their input on the strategy. I'm also grateful for the marketers who provided feedback on our strategy, helping us refine our approach.

Categories: FLOSS Project Planets

Acquia Developer Portal Blog: Changing to Drupal and Maintaining Search Engine Rankings

Tue, 2024-08-06 14:55

So you’ve decided to change to Drupal, or maybe you are making a major upgrade from a really old version of Drupal to a more modern one and you are concerned about your SEO.

Changing content management systems will impact your search engine optimization (SEO), but with careful consideration and planning this can be a positive change rather than a negative one.

What is SEO

There are many misconceptions about search engine optimization, and part of that is because the industry has often been cast in a negative light. Really SEO is the process of making sure your website meets certain guidelines and standards so search engines can understand its content, relevance, and value to users.

Categories: FLOSS Project Planets

The Drop Times: Resurrected with Resilience: Dallas Ramsden's Drupal Legacy

Tue, 2024-08-06 10:18
In an exclusive interview with Elma John from The DropTimes, Dallas Ramsden, CEO and Solutions Architect at Xequals and Drupal Services Specialist at Sparks Interactive, shares his incredible 16-year journey with Drupal. From surviving a life-threatening accident to becoming a beacon of resilience and a dedicated Drupal veteran, Dallas discusses his passion for the platform, his transition to teaching, and his vision for the future of Drupal and technology. Join us to learn from this inspiring story of determination, community building, and lifelong learning.
Categories: FLOSS Project Planets

Drupal Association blog: Preparing for Drupal 7 End of Life: Key Steps to Take Now

Tue, 2024-08-06 10:00

As the end-of-life (EOL) for Drupal 7 approaches on 5 January 2025, site owners must adequately prepare to guarantee their websites' continued security, functionality, and compliance. Here, we outline the key steps to navigate this transition smoothly.

1. Conduct a Comprehensive Site Audit

A thorough site audit is the first step in preparing for Drupal 7's EOL. This process involves:

  • Inventorying Content and Modules: List all content types, modules, themes, and custom code currently in use.

  • Assessing Module Usage: Identify which modules are essential and which can be replaced or eliminated.

  • Checking for Unsupported Modules: Determine if any modules are already unsupported and look for alternative solutions.

  • Evaluating Performance: Analyze site performance to identify any bottlenecks or issues that need addressing during the migration.

2. Plan Your Migration Strategy

With a clear understanding of your site's current state, the next step is to plan your migration strategy. Key considerations include:

  • Choosing the Right Drupal Version: While Drupal 11 is the latest version, you may need to evaluate if an interim upgrade to Drupal 10 is more feasible.

  • Timeline and Budget: Estimate the time and resources required for the migration. Consider factors such as the complexity of your site, the number of custom modules, and the need for design changes.

  • Engaging Stakeholders: Communicate the migration plan with all relevant stakeholders, including developers, content creators, and business leaders, to ensure alignment and support.

  • Extended Long-Term Support: If your migration plan has an unsupported gap, consider utilizing HeroDevs Drupal 7 Never-Ending Support, a secure drop-in replacement for Drupal 7. HeroDevs’ service provides security, compliance, and compatibility updates as you plan your migration. As additional partners join the program, options will be listed in the Migration Resource Center.

3. Select a Certified Migration Partner

Migrating from Drupal 7 to a newer version is a complex task that often requires professional assistance. Selecting a certified migration partner who will provide the expertise and experience needed to ensure a successful transition. Look for partners who:

  • Have Proven Experience: Check for case studies or references from similar migration projects.

  • Offer Comprehensive Services: Ensure they can handle all aspects of the migration, from planning and execution to post-migration support.

  • Understand Your Industry: Partners familiar with your industry can provide more tailored solutions and insights.

4. Update Your Hosting Environment

Ensure your hosting environment is ready for the new Drupal version. This may involve:

  • Upgrading PHP and MySQL Versions: Verify that your hosting provider supports the PHP and MySQL versions required by your new version of Drupal

  • Evaluating Server Performance: Ensure your server infrastructure can handle the new site's requirements, especially if you expect increased traffic or enhanced functionality.

  • Considering a New Hosting Provider: If your current provider doesn't meet the requirements, consider migrating to a provider specializing in hosting Drupal sites.

5. Backup and Test

Before starting the migration, create a full backup of your site. This ensures you have a fallback option in case anything goes wrong. Additionally, set up a testing environment to:

  • Run Migration Tests: Perform a dry run of the migration process to identify and resolve potential issues.

  • Validate Functionality: Test all aspects of the site, including custom modules and integrations, to ensure everything works as expected post-migration.

  • User Acceptance Testing (UAT): Engage end-users to test the site and provide feedback on any usability or functionality issues.

6. Execute the Migration

With all preparations in place, proceed with the migration. Follow a phased approach to minimize disruption:

  • Migrate in Stages: Consider migrating in stages, starting with less critical sections of the site to ensure a smooth transition.

  • Monitor Progress: Continuously monitor the migration process to quickly address any issues that arise.

  • Communicate Changes: Keep all stakeholders informed about the migration progress and any potential downtime or changes.

7. Post-Migration Steps

After the migration, there are a few additional steps to ensure long-term success:

  • Conduct a Final Site Audit: Verify that all content, modules, and functionality have been successfully migrated and are working correctly.

  • Optimize Performance: Implement performance optimizations to ensure the new site runs efficiently.

  • Plan for Ongoing Maintenance: Establish a plan for regular updates, backups, and security monitoring to keep the site secure and up-to-date.

Conclusion

Preparing for Drupal 7's end-of-life requires careful planning and execution. By conducting a comprehensive site audit, planning your migration strategy, selecting a certified migration partner, updating your hosting environment, and following through with testing and execution, you can ensure a smooth transition to a more modern, secure, and efficient version of Drupal. Taking these steps now will help future-proof your website and provide a solid foundation for continued success.

Categories: FLOSS Project Planets

Specbee: How to split configurations across different sites in Drupal 10

Tue, 2024-08-06 04:59
Configuration management is one of the best features introduced in Drupal. It allows developers to easily push configuration changes from development to staging, and finally to production environments. However, some configurations are environment-specific. For instance, modules like Devel, Kint, Views UI, and Google Tag are only enabled in development environments and not in production. Fortunately, the Configuration Split module offers a solution by storing configurations in a separate directory, allowing for environment-specific imports. In this article, you'll learn how to split configurations across different websites using this powerful Drupal 10 module. Setup and using the Configuration Split module Installing the Drupal Configuration Split module is like installing any other contributed module. Use composer to install it since it automatically installs all the necessary dependencies. Open the terminal, within the project and enter the command. $ composer require drupal/config_splitCreate the split configuration Once installed and enabled, we can create one or more "splits" to keep our configuration file in a separate folder. Go to Admin > Configuration > Development > Configuration Split Settings Click Add Configuration Split Setting Enter a Label In the folder field, enter the folder name relative to the Docroot. The path will specify the folder inside which the split configurations should be stored. ../config/dev_splitMake sure the machine name of your split is the same as the folder name. You can keep the split active or inactive by default. These settings can be overridden by settings.php. Choose the module you want to split. In our case – the Devel Module. Since we are pushing the module to a separate config split folder, We have to partially split core.extension.yml file, which stores information about what modules must be installed on your site. Click Save. The config files of the selected module will also be sent to the same folder once you export the config split. The module also enables users to select any particular config file to be split. Activate a Split Once the split is created, it needs to be activated to carry out a split. The Drupal 10 Configuration Split module does not provide a UI for this purpose, but instead, we can modify our settings.php file to activate the split: $config['config_split.config_split.dev_split']['status'] = TRUE;Where, dev_split is the machine name of the split we created earlier. Now, export your configuration using drush cex. You can see the config_split settings getting updated and the module getting removed from your core.extension file, along with respective settings files. To export the configs selected in the dev_split, you have to run a different command, i.e. drush config-split: export “split_name”In our case it would be, drush config-split:export dev_split. Now you can see the files selected in dev_split getting exported to the dev_split directory.  For our Development split, we need to have it activated in the development environment, but not in production. To do so, we add the following to our settings.php on our development environment. $config['config_split.config_split.development']['status'] = TRUE; For the Production site we won't add this code in the settings file, or we can also disable it explicitly by using below code: config['config_split.config_split.development']['status'] = FALSE;Activate split based on environment You can also specify which split should be active in a certain environment by adding a condition in settings.php as shown below: if (isset($_ENV['AH_SITE_ENVIRONMENT'])) {    switch ($_ENV['AH_SITE_ENVIRONMENT'])    {      case 'develop':     $config['config_split.config_split.dev_split']['status'] = TRUE;     break;      case 'live':     $config['config_split.config_split.prod_split']['status'] = TRUE;     break;    }  }The above code will activate dev_split in the development (‘develop’) environment and prod_split in the production (‘live’) environment. Final Thoughts The Configuration Split Module is a fantastic feature introduced in Drupal’s configuration management. By splitting up configurations based on environments, you can use the module only in certain environments, based on your needs. We hope you found this article helpful. For more interesting articles on Drupal and everything technology, please bookmark our blog and come back for more!
Categories: FLOSS Project Planets

Pages