Specbee: Using Drupal 10’s Asset Library to Streamline Asset Handling

Drupal 7 lacked a streamlined mechanism for handling assets, which necessitated the development of more efficient solutions like the Asset Library introduced in Drupal 8 and the latest versions. Asset library solves the problem of loading JS and CSS files on every page. However, unless specified, Drupal does not load these assets as it can affect front-end performance. Let’s learn more about asset libraries in Drupal 10 and how to work with them. What is an Asset Library in Drupal An Asset library in Drupal is nothing but a YAML data structured inside a THEMENAME.libraries.yml file and they contain only CSS and JS files. They are the bundles of CSS and JavaScript files that present inside a module or theme and perform together for style and functionality. The Asset Library in Drupal provides a centralized and organized repository for managing various types of digital assets. Assets Library boasts various features designed to enhance usability, scalability, and flexibility. Asset Library in Drupal is designed to support responsive web design, ensuring that assets are displayed consistently on various devices. Drupal places a strong emphasis on accessibility, and the Asset Library follows these standards to ensure a positive user experience for all. Drupal's Asset Library includes version control features, allowing users to manage and track changes to assets over time. Performance Optimization Define an Asset Library Let’s declare a new Asset library named custom-slider. custom-slider:   version: 1.0   CSS:     theme:       css/custom-slider-theme.css: {}   js:     js/custom-slider.js: {}Some of the attributes used include: Minified: If the file is already minified, set this to True to avoid minifying it again, else default value is False. Preprocess: Default value is True, set to False to exclude a file from Aggregation. Type (Javascript Only):        ◦ The default value is a file, if you leave it blank.       ◦ For external files, use type as external like: //cdn.com/js/example.js: {type: external}Assets Loading Order By default, all JS files are loaded in the order in which files are listed. By default, JS files are loaded in the footer. Set header: true for a library to get loaded in the header. For example: jquery.ui:   header: true   js:     assets/vendor/jquery.ui/ui/core-min.js: {}SMACSS Categorization Drupal follows a SMACSS-style categorization and all CSS files are loaded first based on their category and then by the order. SMACSS categorization is used to set the weight of CSS files, this will not work for JS files. To set CSS weights there are 5 different levels:       ◦ base – This rule consists of styling HTML elements only. CSS_BASE = -200       ◦ layout – Macro management of page or arrangements of elements on the page, including any grid system. CSS_LAYOUT = -100       ◦ component – Components are reusable and discrete UI elements. CSS_COMPONENT = 0       ◦ state – Styles that deal mostly with client-side changes such as hovering links, opening modal dialog, etc. CSS_STATE = 100       ◦ theme – This is purely visual styling such as box-shadow, backgrounds, borders, colors, etc. CSS_THEME = 200 Attach an Asset Library 1. Globally:  We can attach the asset library globally via the THEMENAME.info.yml file, but this approach would work only for a Theme. For any modules you should use hook_page_attachments_alter() or similar. For example: name: 'My Custom Theme' type: theme description: 'A custom Drupal 9 theme for demonstration purposes.' package: Custom core_version_requirement: ^8 || ^9 || ^10 base theme: false libraries:   - THEMENAME/global-styling   - THEMENAME/global-scripts2. Conditionally, via a preprocess function using #attached:  If you need to restrict the library to a particular page or element, then this is the best way to add libraries. For example:Taking a case where we need to attach a library to our page, then we can use hook_page_attachments_alter(): /** * Implements hook_page_attachments_alter(). */ function custom_module_page_attachments_alter(array &$attachments) {   // Adding stylesheet to the page.   $attachments['#attached']['library'][] = 'custom_module/custom-styles';     // Add a custom JavaScript file to the page.   $attachments['#attached']['library'][] = 'custom_module/custom-scripts';   }Or hook_preprocess_page(): /** * Implements hook_preprocess_page(). */ function custom_module_preprocess_page(&$variables) {   // Adding stylesheet to the page.   $attachments['#attached']['library'][] = 'custom_module/custom-styles'; }Similarly, with different preprocess functions we can attach a library using the #attached render array property like: /** * Implements hook_page_attachments_alter */ function custom_module_attachments_alter(array &$page) {   // Get the current path.   $path = $current_path = \Drupal::service('path.current')->getPath();   // If we're on the node listing page, add our retro library.   if ($path == '/node') {     $page['#attached']['library'][] = 'custom_module/custom-styles';   } }3. Inside a Twig template file: Use attach_library() in twig template. {# Attach a CSS library #} {% attach_library('my_theme/global-styling') %} {# Attach a JavaScript library #} {% attach_library('my_theme/global-scripts') %}Final Thoughts Assets Library in Drupal (versions 8 and above) has a profound impact on web development. It centralizes the management of CSS and JavaScript files within modules or themes, ensuring consistency and ease of maintenance across a website or application. By bundling these assets together, developers can efficiently control the presentation and functionality of their digital creations. If you’re looking to implement fantastic features of Drupal like this one in your next project, we have a team of Drupal experts who can help you. We’d love to talk!

The Drop Times: Women in Drupal Luncheon at DrupalCon Portland 2024: A Convergence for Change

Delve into the experiences of women in technology at DrupalCon Portland 2024 with the "Women in Drupal Luncheon" on May 7. This crucial session features Sebastianna Skalisky, Laura Johnson, Jenna Harris, and Shanice Ortiz from Four Kitchens, who will discuss overcoming obstacles and fostering inclusion in the tech sector. Engage with these influential leaders as they share strategies for navigating a male-dominated industry, enhancing female leadership, and advocating for systemic change. Join for a compelling dialogue to empower women and expand their impact on technology.

LostCarPark Drupal Blog: Drupal Advent Calendar 2024 - Call for Ideas

Drupal Advent Calendar 2024 - Call for Ideas lostcarpark_admin Mon, 05/06/2024 - 12:01 Image Image removed. Body

DrupalCon Portland starts today, so it seems a good time to start thinking about the 2024 Advent Calendar!

Advent Calendar? In May?

If there’s one thing I learned last year, it’s start early! We had a few hairy moments last year, and a couple of later nights than I would have liked, so this year I want to get the ball moving early.

Why a Drupal Advent Calendar?

For fun, mostly!

But also to promote the great Drupal projects and the people working on them.

It started on a whim in 2022, when I had the idea at the last possible moment, as I was falling asleep on the last day of November. As there wasn’t…

Drupal Association blog: Drupal lead Dries Buytaert announces a completely new Drupal CMS 23 years after its creation

Image removed.

PORTLAND, Ore., 6 May 2024—Twenty-three years after creating Drupal as a university student and hundreds of thousands of websites later, Dries Buytaert announced today that a new version of Drupal will launch at the end of 2024. Drupal is an Open Source CMS that is foundational to a great digital experience platform. Its reliable, highly secure, and flexible tools build the versatile, structured content needed to create dynamic web experiences.

This new version of Drupal will incorporate the best of the 50,000+ modules created over the past decade into a curated, out-of-the-box experience for organizations wishing to build powerful websites quickly.

“We built this amazing platform to power the most robust digital experiences. And now we will make it more accessible to non-developers,” said Dries. “Drupal Starshot is an initiative that will deliver this new version of Drupal within eight months.”

“The Drupal Association is excited to support the Drupal Starshot initiative and to begin marketing the new version of Drupal as the first, best stop for those interested in understanding what Drupal can do,” said Owen Lansbury, Chair of the Drupal Association’s board of directors.

On 6 May, founder and project lead Dries Buytaert gave an inspiring keynote—also known as the Driesnote—introducing this completely new version of Drupal: Drupal Starshot.

Dries described how, much like the race to space in the 1960s, Drupal is also in a race. The web is moving forward, with or without Drupal. Drupal has a long history of being a leader in the Open Web, but it needs its “Moonshot” moment. Dries reiterated how the future of Drupal’s success will come from broadening its usability to a wider audience. The way to do this, Dries said, is to open Drupal’s powerful tools to non-developers.

What is Drupal Starshot, and how does it differ from the traditional version of Drupal? Drupal Starshot will leverage Drupal Core but have a different governance model to move fast, allowing for more innovation more quickly. 

After Drupal Starshot is introduced, when someone visits the Drupal.org download page, both traditional Drupal Core and Drupal Starshot will be available (under a different name, still to be determined). When Drupal Starshot is selected, it will automatically download the features that the user wants for their use case, making it easier for new users to try and test out Drupal, all from right in their browser. Drupal Core will still be the fundamental building block of Drupal Starshot and can still be used independently from Drupal Starshot for custom builds.

How will this new Drupal be different?

The Drupal that exists today, known as “Drupal Core,” will continue to exist and will be maintained by core maintainers. The Drupal Starshot initiative will introduce a new version of Drupal with a fully featured out-of-box experience.

Features that Drupal Starshot will include are:

  • Next generation page builder
  • Project Browser + Recipes
  • Automatic updates
  • Key contributed modules
  • Easy configuration
  • Default content
  • And possibly more!

Drupal community members who are interested in contributing to the development of Drupal Starshot can submit their interest via this interest form or join Dries at several Birds of a Feather sessions happening during DrupalCon Portland.

Watch the full Driesnote on the Drupal Association YouTube Channel. 

About DrupalCon

This year, DrupalCon North America is a four-day conference held in Portland, Oregon, from 6-9 May. Over 1,300 professionals and Drupal users collaborate on the project for a week. The Drupal Association is a non-profit organization that caters to the needs of Drupal and its worldwide community. It focuses on the growth of the Drupal community and supports the project’s vision to create a safe, secure, and Open Web for everyone. 

About Drupal and the Drupal Association

Drupal is a powerful open-source content management system for everyone, from small nonprofits to enterprises. It is used by millions of people and organizations worldwide, made possible by a community of 100,000-plus contributors and enabling more than 1.3 million users on Drupal.org. The Drupal Association is a non-profit organization dedicated to accelerating the Drupal software project, fostering the community, and supporting its growth.

The Drop Times: Embracing the Community Spirit: DrupalCon Portland 2024

Today is an exciting day as DrupalCon Portland kicks off. The Drupal community eagerly awaits this event for its wealth of sessions, interactions, and updates. From the highly anticipated Driesnote, where Dries Buytaert shares his latest thoughts and plans, to various featured sessions that delve into specific topics, there's much to look forward to.

At this year’s conference, we're seeing updates on various initiatives and a host of workshops and trainings from different organizations. We also have the Healthcare Summit and the Return of the Nonprofit Summit, a great opportunity for Drupal users working in the nonprofit sector to connect and learn from one another.

Recognizing the need to continuously attract new talents to the Drupal community, DrupalCon 2024 has made significant efforts to reach out to students. This includes targeted advertising to local student communities and focusing on the career-enhancing opportunities at the DrupalCon job fair. Mentorship programs, resume help, and a special student discount ticket priced at only $50 are also included.

Another exciting addition this year is the community-designed DrupalCon T-shirt. The Drupal Association ran a contest for the official T-shirt design, receiving many creative entries. The winning design will be announced at the event and featured on the free attendee T-shirt.

Now, let’s look back at what we covered last week:

Alka Elizabeth, sub-editor, TDT, sat down with Thor Andre Gretland, the dynamic Head of Sales and Business Advisor at Frontkom. They discussed the exciting synergies between Gutenberg and Drupal. Thor shared his extensive knowledge about the groundbreaking Drupal Gutenberg project. During this discussion, it was revealed that the Frontkom team has four updates for the community, including major enhancements that will be part of the Drupal Gutenberg 4.0 release, set to be unveiled here at DrupalCon Portland 2024.

Additionally, Alka Elizabeth talked with Angie Byron, the Community Director at Aiven and a highly respected figure in the open-source community. Throughout their conversation, Angie shared her experiences and the pivotal decisions that have shaped her career. She discussed her challenges and transformations, such as introducing automated testing in Drupal, her leadership roles in various community projects, and her advocacy for diversity and inclusion within tech communities. Dive into the interview here

Last week, I had the opportunity to share insights directly from the Drupal Initiative Lead keynote speakers at DrupalCon Portland. Among the speakers were Cristina Chumillas, Janez Urevc, Ted Bowman, Fran Garcia-Linares, Jürgen Haas, and Mateu Aguiló Bosch, who were all set to provide valuable updates and insights on various aspects of Drupal and its ecosystem.

LagoonCon Portland 2024 is set to take place on  May 6, 2024. Following its successful debut in Pittsburgh last year, this free event hosted by amazee.io is designed for developers and tech leaders to dive into discussions about Lagoon. Alka Elizabeth, sub-editor at The Drop Times, has penned an article featuring detailed discussions with the speakers of Lagoon Portland,  Toby Bellwood, the Lagoon Product Lead at amazee.io, Christoph Weber, Solutions Architect at Pronovix, and Bryan Gruneberg, CEO and CTO at Workshop Orange. 

Norah Medlin brings over two decades of software development immersion to Stanford WebCamp, offering a strategic blueprint for maximizing project success. In her session on forging high-value partnerships and driving transformative change, she unveils essential insights for navigating the complexities of modern project management. 

Linux Foundation has launched the 2024 World of Open Source: Global Spotlight Survey, designed to examine the nuances of open-source technology in different regions and industries.

DrupalCon Barcelona 2024 is calling for submissions of case studies highlighting exceptional Drupal website projects developed between October 2023 and September 2024. The Drupal Camp Pune 2024 organisers seek talented individuals passionate about technology and community building to volunteer and add a unique touch to the array of planned activities.

DevOps professionals on the making can take the Pantheon WebOps certification exam onsite at the DrupalCon Portland venue. The exam registration is free of charge. 

Additionally, Carlos O. launched the IXP Fellowship initiative to help aspiring Drupal developers bridge the skills gap. The program sought community feedback through a survey to define competencies for inexperienced developers aiming to become junior professionals.

Other generic updates are here: Maotic, for the first time, has become a mentor organization for the coveted Google Summer of Code project for 2024. Learn about their winning projects here. Drupal is introducing an experimental navigation module in version 10.3 prior to introducing it officially in Drupal 11. Selwyn Polit's online reference book, "Drupal at your fingertips" is now officially listed in Drupal.org. Last year's Drupal Pitch-burgh contest-winning project, Drupal API Client, has released version 1.0. A new Drupal podcast has begun. Platform.sh DevRel Team has started a new podcast series called 'ChangeMode'. Marine Gandy hosts the show. 

We acknowledge that there are more stories to share. However, due to selection constraints, we must pause further exploration for now.

Stay tuned with The Drop Times. We are here to ensure you don't miss out on anything happening at the event. Our volunteers are on the ground to keep you updated with interviews, featured articles, coverage of sessions, and short video interviews with attendees and speakers.

To get timely updates, follow us on LinkedIn, Twitter and Facebook. Also, join us on Drupal Slack at #thedroptimes.

Thank you,
Sincerely
Kazima Abbas
Sub-editor, The DropTimes.

Talking Drupal: Talking Drupal #449 - Agile Methodologies

Today we are talking about Agile Methodologies, How to pick the best one, and why they matter with guest Chris Wells. We’ll also cover CKEditor Text Transformation / AutoCorrect as our module of the week.

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

Topics
  • Drupal FL Camp talk
  • Fundamentals of Agile
  • How do you square long term planning
  • What is Redfin Solutions's preferred methodology
  • What is Crystal Agile Methodology
  • Do other methodologies have web specific versions
  • Would you agree that large companies can use different agile methodologies
  • Have you ever used Scrumban
  • Listener Question: Shivan xamount:: Story points are usually equated to fibonacci numbers. These are not supposed to correlate to hours, what do you think about that?
Resources Guests

Chris Wells - chrisfromredfin.dev chrisfromredfin

Hosts

Nic Laflin - nLighteneddevelopment.com nicxvan John Picozzi - epam.com johnpicozzi Matthew Grasmick - grasmash

MOTW Correspondent

Martin Anderson-Clutz - mandclu

  • Brief description:
    • Have you ever wanted CKEditor to autocorrect symbols like the copyright mark, the “not equals” sign, and fractions, from their text equivalents? There’s a module for that
  • Module name/project name:
  • Brief history
    • How old: created in Mar 2024 by Gedvan Dias of Redfin Solutions
    • Versions available: 1.0.0-alpha1, which works with CKeditor 4 on Drupal 8, and 2.0.0-alpha1, which works with CKEditor 5 on Drupal 9 and 10
  • Maintainership
    • Actively maintained, was released just a few weeks ago
    • Not much documentation of its own, but the module leverages CKEditor’s Automatic text transformation, which has a fair bit of documentation on CKEditor.com
    • Number of open issues: only 1 open issues, which is the Project Update Bot’s automatically-created Drupal 11 compatibility issue
  • Usage stats:
    • 8 sites
  • Module features and usage
    • By default the module enables four categories of transformations: 'symbols', 'mathematical', 'typography', and 'quotes'
    • You can override the module’s plugin if you want a different set enabled, but the module also provides a hook you can use to alter the active sets or define custom transformations, similar to using emojis in Slack, for example

Drupalize.Me: DrupalCon Portland 2024: Issue Queue Initiatives

DrupalCon Portland 2024: Issue Queue Initiatives

This Wednesday, May 8, I'm speaking at DrupalCon Portland 2024 as part of the Drupal Project Initiatives Keynote. The keynote is kicking off Contribution Day on Wednesday first thing in the morning. I'll be highlighting initiatives and programs that are helping people contribute in a strategic way, and as a result, increasing throughput in the core issue queue. Throughput is the rate that a project’s issues are resolved and committed. And it’s one way to gauge the health of an open source project like Drupal.

Check out these resources to learn more about the initiative and programs I highlight in this presentation.

Amber Matz Mon, 05/06/2024 - 11:00

Event Organizers: Connect with Event Organizers at DrupalCon Portland '24

There are many opportunities to connect with fellow event organizers throughout the week at DrupalCon Portland 2024.

All Week

Community Events Booth
Expo Hall - #106
Visit with the EOWG board and other event organizers in the Expo Hall. Be sure to bring some of your stickers and swag to share with the community!

Monday, May 6 - 2:00 - 3:00pm

Event Organizers Roundtable BOF
Room G132, Table 1
Open discussion time for Drupal Event Organizers to gather and for others who are interested in organizing their own events or learning more about the Event Organizers Working Group.

Wednesday, May 8 - 9:00am - 5:00pm

Contribution Day
Room B115-116
Find us to help improve the Community Events page.

Thursday, May 9 - 9:00am - 4:00pm

Community Summit 
Room C120-122
EOWG Board members will present a panel at 9:15am. Join us for a day of community discussions. The summit is open to everyone in the Drupal community, at no additional cost.

Not joining DrupalCon? Join us online any time:

Open Meeting via Slack!
Tuesday, May 14 starting at 16:00 UTC / 12:00 pm ET

  • Initiative Updates
  • Camp Reports
  • DrupalCon Report

Join us to discuss these and other topics in the #event-organizers channel.

If there is something you want to share or discuss related to your camp, meetup, or other events organizer topics either leave a message in the Slack channel or comment on the Drupal.org meeting agenda issue.

Drupal Association blog: De-jargoning Drupal – working with the community to open up Drupal’s terminology

This blog post was written by Promote Drupal committee member Emma Horrell.

If you’re familiar with Drupal, you will have learned its language. You will be familiar with words like Views, Blocks and Paragraphs, and you will appreciate their respective features and functions. But for those new to Drupal, getting to grips with what words mean can mean a steep learning curve. 

The start of the Drupalisms issue

User research to improve the Drupal admin UI raised an interesting finding. When the Drupal community was asked to complete an exercise where they grouped terms from the UI into categories that made sense to them, the results showed people were unable to place some of the terms. Further investigation indicated that people weren’t sure what these outlier terms meant (and therefore they had struggled to sort them).

How we speak Drupal matters

We wanted to address this finding from the research because we recognised the importance of people understanding Drupal terminology to enable and empower them to use Drupal confidently and competently. We strongly felt that Drupal language shouldn’t be a barrier to people new to the community learning and we wanted to take the opportunity to address this. It felt like the most logical place to start was to identify Drupal terms that caused confusion - ‘Drupalisms’. With a core team of community volunteers behind it, issue 3381734 was begun.

First endeavours to identify Drupalisms

With the issue live, we set to work, picking out terms that matched the ‘Drupalisms’ brief – in other words, terms which we felt were confusing to new Drupal users. Our initial list included words like: ‘Node’, ‘Blocks’, ‘Structure’, ‘Entity’, ‘Paragraphs’. As the issue queue gained momentum, more words flooded in, and people expressed opinions on aspects of Drupal terminology – for example, questioning Drupal’s use of ‘Site Builders’, ‘Developers’ and ‘Themers’ to describe the roles and functions of the Drupal community.

Drupalisms BoF at DrupalCon Lille

Attending DrupalCon Lille presented the chance to run a Drupalisms BoF to encourage people from the community to come together and collaborate on this issue. We spent the time looking at our initial list of terms, thinking of more, and thinking about how we would describe them to people new to Drupal. This exercise helped us appreciate the importance of preventing language being a blocker to new Drupal users and therefore affirm the importance of the issue.

Establishing regular meetings to work together  

Coming together after the BoF, we reflected on possible ways forward. We established that our original goal to identify Drupalisms was part of something bigger, an impetus to make sure our language opens up Drupal to everyone, to ensure we are being as accessible and inclusive as possible. We all agreed this was not something fixable quickly, and we committed to a regular pattern of fortnightly meetings to work on the issue.

Acknowledging challenges and opportunities

Our initial meetings were spent discussing the issue in more depth. We thought about the varied mental models, expectations, native languages and levels of understanding people bring to Drupal, and how their prior experiences (sometimes with other Content Management Systems) shapes their language perceptions. We considered the roles that glossaries tooltips and micro-copy can play in helping people make sense of our terminology in different contexts. We thought about the past – and how historic events had led to the language we use in Drupal today, and then ahead to the future, thinking about the impact of changing terminology and the possible consequences. We also established that language is an emotive subject, and therefore that making decisions about language should be based on evidence over opinions.

Adopting a methodical approach towards a controlled vocabulary

Ralf Koller suggested an objective, multi-step approach to working on the issue inspired by various sources including Abby Covert’s book ‘How to make sense of any mess’, Sophia Prater’s Object-Oriented-User-Experience (OOUX) methodology and the writings of other content design specialists like Erica Jorgensen. The stages we are working through are as follows:

  1. Noun foraging – making a full list of all the Drupal terms
  2. Evaluating/prioritising the most confusing terms based on responses from the community and also how easy it is to define them
  3. Deciding which terms to include in a controlled vocabulary
  4. Producing translations of these terms
  5. Developing a ‘words we don’t say’ list
  6. Establishing a process to maintain the vocabulary going forwards

Collaborating with other open-source Content Management Systems

Addressing issues of CMS language more broadly, and acknowledging that Drupal is not alone in wanting our vocabulary to be intuitive and easy-to-understand, I’ve reached out to others in the wider open-source CMS community to think of ways we can use our collective force to develop a more consistent approach to CMS terminology. It’s early days but there is interest, and we’re looking to establish a date for an initial meeting.  

Where we are now and how you can help

We’re working together on the first stage of the process - the noun foraging, gathering terms from many sources. Our current list stands at around 400 terms and we know there will be more. If you would like to join in helping us with this piece of work or you are interested to know more, please comment in the issue queue, join the Drupal Slack channel #drupalisms-working-group, message me on Drupal Slack or email me directly at emma.horrell@ed.ac.uk and I can provide more information or add you to the meeting series. You can also read the ongoing meeting notes from the issue queue.