Talking Drupal: Talking Drupal #425 - Modernizing Drupal 10 Theme Development

Today we are talking about the a new Drupal Book Modernizing Drupal 10 Theme Development, What’s new in Drupal 10 theming, and tools that can help speed up theming with guest Luca Lusso. We’ll also cover Admin Dialogs as our module of the week.

For show notes visit: www.talkingDrupal.com/425

Topics
  • Why write a book about Drupal theming
  • How does the book modernize theming
  • Who is the book for
  • Do you have to have a certain level of knowledge to start
  • What are some new aspects of Drupal 10 that are covered in the book
  • Does the book talk about:
    • Javascript frameworks
    • Native Web Components
  • What tools outside of Drupal do you talk about
  • How did you conduct your research
  • Do you have plans to keep the github updated
  • How long did it take to write the book
  • Tech moves quickly, what is the shelf-life of the book
  • Future editions
  • Purchase from Amazon or Packt
  • Translation
  • Plans for another book
Resources Guests Hosts

Nic Laflin - nLighteneddevelopment.com nicxvan John Picozzi - epam.com johnpicozzi Melissa Bent - linkedin.com/in/melissabent merauluka

MOTW Correspondent

Jacob Rockowitz - @jrockowitz Admin Dialogs

  • Brief description: (from the maintainer)
  • Brief history
    • How old: Created on May 2023
    • Versions available: 1.0.x stable release
    • Last release: 1.0.17 - July 12, 2023
  • Maintainership
    • Actively maintained? Yes
    • Number of open issues: 6
    • Test coverage
      • No test coverage
      • Module is fairly simple and easy to manually test
      • Code quality is very good
  • Usage stats:
    • sites 150+
  • Maintainer(s):
  • Sponsor
    • Chapter Three
  • Module features and usage
    • Comes with the ability to add modal or off-canvas dialogs to different links in Drupal.
    • Easy to use. Most features available after installing the module.
    • Adds controls dialog type for operation links like Edit, Delete etc.
    • Adds and controls dialog type for local tasks.
    • Adds and controls dialog types for local actions.
    • Ability to add dialogs via specified A tag paths.
    • Ability to add dialogs via specifying CSS selectors (classes and IDs).
    • Adds option to control delete button dialog.
    • You can add support for your modules by adding configs created in the module.
    • Experimental: Add loading spinner to form submit elements on form submit.
  • Discussion
    • The module does one thing and does it really well
    • Require no initial configuration.
    • Worth reviewing common administration tasks for contributed modules and deciding if a modal dialogs or sidebar can improve the admin UX.

The Drop Times: Through the Fields of Desire

Dear Readers,

Have you ever found yourself standing on the hallowed grounds of a game field, surrounded by the dispersing crowd after the exhilarating clash of Titans? You close your eyes and immerse your soul into a space, in all its nooks and corners, you so wished to be present. It's a unique form of astral projection, fueled not by science but by the sheer force of desire.

You stand there, taking in all the heat and vigor that field contained minutes before. You feel the lingering warmth of the competition, the echoes of cheers and roars that once filled the air. The field was a sacred space where legends once broke sweats, champions basked in glory, and hearts shattered in defeat. I can't fathom which will be louder, the cheers of the win or the agony of the loss. I suppose it will be what your heart resonates with most.

Nevertheless, your favorite heroes might be grappling with the sting of loss, but amidst the pain, there's an undeniable awe for the magnificent game played by others. You might catch snippets of satisfaction, determination, and even complaints in the fading murmurs. After all, it's a game; one wins while the other loses, and still, it is only a game, and more games will come!

In this field of desire, the cycle continues. Your heroes are already picking themselves up, now bearing the weight of criticism and shame. They brush off their shoulders, drowning out the din of naysayers. It's a journey!

Similarly, there are instances where Drupal may face setbacks, encountering the echoes of coding challenges and the occasional murmurs of discontent. It's a dynamic game where advancements and setbacks coexist. Yet, like the heroes on the physical field, the Drupal community persists. After moments of criticism and setbacks, Drupal picked itself up, learning from the experiences and evolving to conquer new coding horizons powered by desire.

On that note, let's look into the top stories by The DropTimes from the past week.

With a bang, Drupal debuted at the Web Summit Lisbon, one of the largest and most influential technology conferences worldwide! The keynote address was delivered by Baddy Sonja Breidert, the former chair of the Drupal Association. Dries Buytaert expressed gratitude for the substantial support from key sponsors, including 1xINTERNET, Acquia, FFW, and Phase 2. Alex Moreno posits the recent foray into Web Summit in Lisbon served as a concrete stride toward escaping the confines of the Drupal bubble. The NEDCamp 2023 also came to a glorious conclusion!

In the wake of the end of the life of Drupal 9, the Drupal community is buzzing with calls for migration. The blog post by Symetris highlights the need to upgrade to Drupal 10, which offers improved content management, enhanced security, performance optimizations, personalization features, and a new front-end theme, among other benefits. Also, Acquia has strategically moved to retire the Drupal 9 Certification exams, scheduled for November 30, 2023. With a substantial 47.5% of websites remaining in Drupal 7, Promet Source stresses the growing disparity between the capabilities of Drupal 7 and the advancements incorporated into Drupal 10, positioning the latter as a superior, performance-optimized, and feature-rich web platform.

The hums of DrupalCon Lille still haven't settled with Drupalists discussing sustainability and inclusivity lessons from the Conference. Specbee's latest blog post, penned by Siddhant, explores the transformative power of Google Analytics 4 (GA4) and its impact on Drupal marketing strategies. Meanwhile, DrupalCon Portland 2024 has initiated the Call for sponsors. Acquia has unveiled the winners of the 2023 Engage Awards, recognizing organizations that excel in delivering innovative digital experiences by uniting marketers and technologists.

Remarkably, PreviousNext recently wrapped up a crucial phase in developing a decoupled Layout Builder for Drupal, led by Lee Rowlands, as part of the Pitchburg Project. Notably, the project's success extends beyond the conclusion of its statement of work, as it serves as a foundation for continued advancements within the Drupal community. Acquia has announced its acquisition of Monsido, a platform specializing in website accessibility, content quality, search engine optimization, data privacy, and performance.

The Commerce CyberSource module for Drupal has successfully tackled third-party library conflicts, unveiling its Drupal 10 version with improved payment processing capabilities. Drupal users seeking optimal page caching now have a robust solution with the LiteSpeed Cache module tailored for Drupal 8 and beyond. The article by Kevin Quillen from Velir discusses the key module, which offers multiple methods for referencing and safeguarding secrets in the Drupal content management system.

DrupalEasy is set to commence its spring semester of Professional Module Development on January 30, 2024. The 12-week course is led by industry veteran Mike Anello. Similarly, Emble provides personalized Drupal training courses at three proficiency tiers: Drupal Web Editor, Drupal Application Manager, and Drupal Developer. The classes are designed to cater to individual needs and organizational requirements, ensuring effective and swift knowledge transfer.

Oliver Davies launches the inaugural episode of the Beyond Blocks podcast featuring Matt Glaman. Authored by the experienced Mike Hubbard, Acro Commerce shared insights on configuring Drupal and React/TypeScript components. Lucio Waßill has introduced the "Monitoring Ntfy.sh Integration" module. This innovative addition to the Drupal ecosystem promises to enhance monitoring capabilities by providing real-time notifications through the Ntfy.sh platform. Gatsby.js, the open-source framework powered by React, GraphQL, and Node.js, excels in crafting high-performing, content-rich sites and is the prime discussion in the latest article by the AIVAnet team.

This encapsulates the highlights from The Drop Times. We invite you to share any suggestions, contributions, or feedback, as we sincerely value your engagement within our community. Thank you for being part of this journey. Until our next edition, keep exploring, sharing, and embracing the power of knowledge!

Follow us on LinkedIn, Twitter, and Facebook for regular updates.

Warm Regards,

Alka Elizabeth
Sub-editor, TheDropTimes

DrupalEasy: Test-driving GitLab CI templates for Drupal contributed modules

Image removed.Earlier this year, the Drupal Association (DA) and various community contributors announced the general availability of GitLab CI (Continuous Integration) for Drupal contributed modules. The goal of this project is to replace the existing, bespoke, Drupal CI for running automated tests for both Drupal core and contributed projects with GitLab's existing CI tools, thus saving community and DA resources in the long-term. 

For contributed module maintainers, this means being able to specify more flexible tests and code validations, depending on the module's unique needs. 

Much of this functionality will be made readily available to module maintainers via GitLab templates that offer a rock-solid starting point for module maintainers. 

What can GitLab CI do?

First, some basics. The general idea is that for every commit to a contributed module project (including on issue forks,) GitLab CI will run a maintainer-defined process to run various checks on the code. These checks normally include validation steps like ensuring the project's composer.json file is valid, coding standard checks via phpcs, and static code analysis checks via PhpStan. The checks will often include testing steps that run the module's PhpUnit tests in various Drupal environments (different versions of Drupal core and PHP.)

By default, these checks - called jobs in GitLab CI parlance - are divided into three stages: build, validate, and test.

Image removed.

Upon completion of the pipeline (all of the defined jobs in all the stages), GitLab CI will display the results. The previous image shows a completed passing pipeline for the Markdown Easy module (note that I opted the Markdown Easy module into additional jobs - more on that below.)

If any of the jobs fail, then the project's contributors have access to detailed logs to help diagnose and correct any issues. Module maintainers can also decide which, if any, failures are not deal-breakers and decide to accept the changes anyway. It is clear that the system was built with flexibility in mind.

How does a module maintainer get started?

This is the best part - it's ridiculously easy. The DA and community contributors have created a set of templates to get you started with a basic pipeline. From the GitLab interface for a contributed module project (via https://git.drupalcode.org/,) all a maintainer has to do it click to add a new file, name it ".gitlab-ci.yml" and a "Template" dropdown will automagically appear for them to select the template:

Image removed.

 

Once the template is selected, all the maintainer has to do is commit the file to the repository and the module will have a basic pipeline up-and-running.

The basic pipeline provides both validation and PhpUnit jobs in the current version of Drupal core. 

But wait, there's more!

Want to run more tests against different versions of Drupal core (past or present) or versions of PHP? The variables template includes documentation on variable overrides to add/remove/modify pre-defined jobs.

Two of the most useful groups of variables provided by the Drupal GitLab CI templates are of the form SKIP_* and OPT_IN_* - these allow module maintainers to easily skip some jobs and opt-in to others. For example, want to skip the PhpStan validate job? Simply add the following to your module's .gitlab-ci.yml:

SKIP_PHPSTAN: 1

For an example of the OPT_IN_* variables, let's go back to the initial image above for Markdown Easy, all of those jobs shown were run by adding only the following to the module's .gitlab-ci.yml file:

OPT_IN_TEST_PREVIOUS_MAJOR: 1 OPT_IN_TEST_MAX_PHP: 1 OPT_IN_TEST_PREVIOUS_MINOR: 1 OPT_IN_TEST_NEXT_MINOR: 1 OPT_IN_TEST_NEXT_MAJOR: 1 # Show more log output _PHPUNIT_EXTRA: --verbose # Convenient, and we have no secrets. _SHOW_ENVIRONMENT_VARIABLES: 1

OPT_IN_TEST_PREVIOUS_MAJOR refers to the previous major version of Drupal core (Drupal 9).

But wait (again,) there's even more!

Because all of this stuff is built on-top of out-of-the-box Gitlab CI functionality, module maintainers who are comfortable with .gitlab-ci.yml syntax can implement any CI process they can dream up. In the past few weeks, there have been discussions (and successes) of adding Yarn, generating GitLab pages that generate a documentation page for the module, and more!

What's the downside?

As far as I can tell, there are at least two potential issues that the DA and contributors are keeping their eyes on:

  1. Change is hard. A big effort is going to be required to get module maintainers to switch to this new way of doing things. Luckily, this new way has a lot more flexibility, so that will definitely help.
  2. Running Gitlab CI pipelines isn't free - the DA is spending thousands of dollars each month to accommodate this functionality (granted, Drupal CI wasn't free either.) The hope is that Gitlab CI will provide much higher levels of efficiency over Drupal CI (many speed improvements have already been made and more are being worked on) thus decreasing the cost. But, if it is easier for contrib module maintainers to run more tests, then that could have the opposite effect. I suspect that at some point, module maintainers will be provided some guidance as to how to minimize their CI "footprint". While the DA can control some of this from the templates defining the rules for when a pipeline runs, it is important that maintainers stick to these guidelines and not overuse GitLab CI by adding scheduled pipelines or other resource intensive pipelines.

Is this a finished product?

Absolutely not. The DA and contributors have regular Gitlab Acceleration Initiative meetings (normally every-other-week) in the #gitlab channel of the Drupal Slack workspace. Also, the issue queue is the place where most of contrib work happens; so file an issue, work on an existing one, test where possible to help accelerate even further.

Much of the recent effort has been toward adding features (like PhpStan and Drupal 7 support) to the default templates as well as looking for ways to optimize the pipeline for both speed and resources ($$$.)

Thanks so much to Fran Garcia-Linares, one of the main developers of the Drupal GitLab CI templates, for reviewing (and adding to!) this blog post.
 

LN Webworks: Installing Google Analytics in Drupal: A Detailed Guide

Image removed.

Google Analytics is a cutting-edge web analytics service. As the name suggests, it is offered by Google and works wonders in helping digital marketing teams track website traffic, user behavior, how visitors interact with a site, their geographical location, and preferences. These valuable insights are crucial for every business for performance management and moving on an upward spiral of growth. In this blog, we’ll delve into how to install and utilize Google Analytics in Drupal. Are you ready for the enchanting journey? 

Drupal Google Analytics: The Incredible Module You Need

Drupal Google Analytics is a phenomenal module that empowers you to gather data about your Drupal site’s traffic and activity and direct it to Google Analytics. As soon as you install the Google Analytics module, it will naturally add the necessary tracking code to your valuable business website. This will aid in the accurate collection of data. The best part is that data collection will start happening right away after the tracking code is added. Sounds great. 

ANNAI Magazine: jGrants: Grant application and management system for the Ministry of Economy, Trade and Industry of Japan

Image removed.

ANNAI worked closely with the METI for the last three years, conducting fundamental research and developing the system using an agile development methodology. In this blog post, we will describe the unique challenges of agile development involving Japanese ministry, the project's history, as well as the benefits.

Gbyte blog: Simple XML Sitemap 3.1 released with major new features

This is a technical description of the 3.x branch of the module. For the newer 4.x branch, see this article.

Simple XML sitemap 3.1 has been released

The third major version of simple_sitemap has been long in the making bringing a more reliable generation process, a significantly more versatile API and many new functionalities. The first minor ugrade of the 3.x branch comes with views support and human readable sitemaps.

Major new features in 3.1

Image removed.Views and views arguments support

Including view display URLs in the sitemap has been possible through adding these URLs as custom links in the UI (or via the API).

View variations created by view arguments however are tedious to include as one would have to include every version of the URL.

The integration of the simple_sitemap_views inside simple_sitemap 3.x makes it easily doable via the UI.

Thanks to @WalkingDexter for his tremendous work on this submodule!

 

Human-readable sitemaps with XSL stylesheets

Before: