Feed aggregator
DrupalEasy: Method for cloning and working on Drupal contrib projects
The Drop Times: Ronald te Brake Proposes AI Coding Starter Kit for Drupal Developers
The Drop Times: Accessibility Made Simple: acolono Launches Audit-Package with an Additional Pledge for the Drupal Community
Profile IQ
Dripyard Premium Drupal Themes: The most commonly used ARIA attributes on Drupal sites
You’ve probably heard, “The first rule of ARIA is don’t use ARIA". This is a tongue-in-cheek reference to the movie Fight Club, but the reality is more nuanced. The real rule is: “Don’t use ARIA, unless you need to.” The TLDR: lean on native HTML whenever possible, but when HTML alone isn’t enough, ARIA fills the gaps. So when do we reach for ARIA in Drupal theming?
In this article, we’ll walk through some of the most common ARIA attributes you’ll encounter when building Drupal sites.
What is ARIA?ARIA (Accessible Rich Internet Applications) is a set of HTML attributes that give assistive technologies (like screen readers) more context about elements.
For example, ARIA can:
The Vardot Team: Dependency Injection in Drupal
The Vardot Team: Dependency Injection in Drupal
UI Suite Initiative website: UI Suite Monthly #18 - Major Reorganization and UI Patterns 2 Reaches 80% Completion
Dripyard Premium Drupal Themes: Now is the time for premium Drupal themes
Ask anyone about Drupal’s strengths, and they’ll talk about content modeling: custom content types, views, workflows, and permissions that can be built entirely through the UI. No other CMS matches Drupal’s flexibility for complex information architectures.
But once the backend is in place, you still need to make it usable and beautiful for real people. And that’s where things get hard.
Drupal theming is expensive.Theming in Drupal has historically been expensive and complex. Unlike WordPress or Webflow, you can’t just drop in a template and go. A proper Drupal theme requires specialized knowledge of:
UI Suite Initiative website: UI Suite Monthly #27 - From Components to Core Integration
UI Suite Initiative website: UI Suite Monthly #26 - Building the Future of Drupal Design Systems
UI Suite Initiative website: UI Suite Monthly #24 - Design System Revolution Takes Shape in Drupal
UI Suite Initiative website: UI Suite Monthly #23 - Wrapping Up a Milestone Year and Building Toward UI Suite 2.0
UI Suite Initiative website: UI Suite Monthly #22 - Major Transitions and Exciting Developments Ahead
UI Suite Initiative website: UI Suite Monthly #21 - Major Milestones and Strategic Transitions Ahead
UI Suite Initiative website: UI Suite Monthly #20 - Two Years of Progress and Major Milestone Releases
Joachim's blog: The big plugin attribute change-over made easy
Attributes are here and they're great. I hated annotations; they were a necessary evil, but putting working code into comments just felt wrong.
But the conversion work is still ongoing: many contrib modules (and perhaps custom ones too) need to convert their plugin types to being attribute-based. There is time to do this: code in \Drupal\Core\Plugin\Discovery\AttributeDiscoveryWithAnnotations announces that attributes on plugins are required from Drupal 12, with the old-style annotation allowed to remain alongside it for backwards-compatibility until Drupal 13.
But the sooner you convert plugin types to attributes, the sooner you benefit from imported classes in definition values, the ability to put comments within the annotation, cleaner translation of labels, and use of PHP constants in attribute keys or values. And IDE autocompletion of the plugin definition keys, if you're not using Module Builder to generate your plugins (why, though? why?).
With Drupal Rector you can convert individual plugins from annotation to attribute, but to convert a plugin type, you need more than that.
Module Builder can help with this with its Adoption feature. This adds items to your module config based on the existing code, which allows you to alter or add to the code definition before re-generating it. (This feature is particularly useful for adding further injected services to an existing class such as a plugin or a form.)
Release 4.5.4 of Drupal Code Builder (the library that powers Module Builder) added adoption of plugin types, and this opens the door to converting a plugin type from annotation to attribute. The steps are are follows:
- Go to Administration › Configuration › Development › Module Builder.
- If your module is not already defined in Module Builder, click 'Adopt existing module', then find your module in the list and click 'Adopt module and adopt components'. If you already have the module in Module Builder, go to your module's 'Adopt' tab.
- On the adopt components form, select the plugin types you want to convert.
- Click 'Adopt components'.
- Go to the 'Plugins' tab of your module. Your plugin types should be in the form.
- Change the discovery type of each one to 'Attribute plugin'. The values will carry across (this is actually a problem with FormAPI that I've never managed to figure out, but it's actually quite handy).
- Go to the Generate tab.
- Select the files to write. For each plugin type, you'll want the plugin manager, and the new attribute class.
You should verify the new attribute class. Properties will have been adapted from the annotation class but they may not all be correct. In particular, default values for optional properties aren't yet handled by Module Builder, so you'll need to add those.
Once you've tidied up the attribute class, your plugin type is now attribute-enabled. (You should run the tests that cover plugins just to make sure everything is fine.)
The plugins of this type in your module are still using annotations, so now we turn to Rector.
There is full documentation on converting plugins but the gist of it is this:
$rectorConfig->ruleWithConfiguration(\DrupalRector\Drupal10\Rector\Deprecation\AnnotationToAttributeRector::class, [ new \DrupalRector\Drupal10\Rector\ValueObject\AnnotationToAttributeConfiguration( '10.0.0', '10.0.0', 'MyPluginType', 'Drupal\my_module\Attribute\MyPluginType', ), ]);Run rector on just your plugin folders to make it go quicker, since you know where the plugin files are:
vendor/bin/rector process path/to/module/src/Plugin/MyPluginTypeThat converts all the annotations, but unfortunately, it doesn't format them properly: the whole thing ends up all on one line. And PHPCS and PHPCBF don't know how to format an attribute either.
But regular expressions come to the rescue, and fortunately the syntax of attributes is fairly distinct.
In your IDE, a search of '(?=\b\w+: )' replaced with '\n ' (note two spaces, for the indent) will put each property onto its own line. It won't handle array values though. And beware: it will catch the use of colons in text strings! This is an instance where using a GUI for git makes quick work: stage the fixes to the attributes, discard everything else.
That leaves just the terminal closing bracket, which you can do by hand, or cook up a regex if you have a lot of plugin classes.
joachim Tue, 02/09/2025 - 13:17 TagsDrupalCon News & Updates: DrupalCon Vienna 2025: Top 5 Technical Reasons to Attend
DrupalCon Barcelona 2024 by Bram Driesen
Ready for a truly technical deep-dive? At DrupalCon Vienna 2025, you’ll gain insights from cutting-edge sessions, hands-on workshops, and direct interaction with the maintainers shaping Drupal’s future. Here are the top five technical reasons you can’t miss this year:
1. Shape the Future with Drupal CanvasDrupal Canvas debuts at DrupalCon Vienna with the session "Drupal Canvas Unleashed: The Future of Drupal is Here" by Lauri Timmanee and Bálint Kléri. This session unveils the production-ready Drupal Canvas and shows how it transforms Drupal site-building through a component-driven, in-browser development workflow. Learn how to:
- Kick-start new sites with faster, more collaborative builds
- Leverage UI-embedded code and reusable components for efficiency
- Incorporate existing modules into this modern architecture
2. Maximize Performance with DevOps and Network-Level Enhancements
Don’t miss "TCP Fast Open and HTTP/3: Network-Level Optimizations for Lightning-Fast Drupal" by Nicolas Perussel, where you'll dive into advanced networking techniques that can dramatically reduce latency and improve load times. Combine that with "Secure by Design: Integrating Security into Drupal Development" by Janna Malikova — learn how to bake essential security practices into every step of your build and deployment pipeline. This combo gives your projects real-world robustness and performance.
3. Explore AI-Powered Workflows and Multibrand Architecture
DrupalCon Vienna spotlights enterprise innovation through sessions like "Drupal AI – Strategy and Application" by Christoph Breidert and Frederik Wouters, and "Nestlé Nutrition Scalable Multibrand Design System on Drupal" by Olga Tsiamliak and Bastien Chanot. Get inside:
- Strategic approaches to applying AI workflows in Drupal projects
- Modeling large-scale, flexible design systems in a multisite environment
- The role of AI-driven automation in enhancing editorial and marketing efficiency
4. Hands-on Learning Through Contribution, Workshops & Labs
With over 100 expert-led sessions, plus workshops and a dedicated Contributor Day, DrupalCon Vienna isn’t just about inspiration. It's about execution. Participate in:
- Code labs that walk through module development, debugging, and API integration
- Workshops on CI/CD flows, configuration management, and production optimization
- Live contribution opportunities where you can get real code reviewed and merged
This immersive, practical environment helps you bring new skills directly into your projects.
5. Gain Vision Through Keynotes and Future-Focused Talks
DrupalCon Vienna features four keynote presentations, including the Driesnote by Drupal founder Dries Buytaert, plus forward-looking panels such as "The Web in 2035" and "Drupal CMS Spotlights". These sessions offer:
- Strategic insights into Drupal’s evolution and roadmap
- Speculative discussions about the future of open web technologies
- Inspiration for how Drupal can lead next-generation digital experiences
- Track-based learning: With seven technical tracks — from Drupal CMS and InfoSec & DevOps to Clients & Industry Experiences — you can dive deeply into the areas most relevant to your role and interest.
- Strategic immersion: Whether you're refining DevOps pipelines, architecting large-scale builds, or integrating AI into workflows, DrupalCon Vienna gives you actionable knowledge to level up your projects.
Ready to be at the forefront of Drupal innovation?
Prepare your personalized agenda, explore new sessions, and let DrupalCon Vienna 2025 be the turning point in your Drupal journey.
So bookmark this space, and get ready to experience DrupalCon Vienna 2025 like never before.
Are you coming? Let’s connect!
Technical Lead
WSO2
DrupalEasy: Reclaim Docker disk space when using DDEV
Pages
