Planet Drupal

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

The Drop Times: Empowering Women in Drupal

Mon, 2023-12-11 09:39

Let's dive into something awesome today—the fantastic women rocking the tech world, especially in our Drupal community. There's no fluff, just facts about how they're taking Drupal to new heights.

Women are making waves in the tech world, and right here in Drupal, they're levelling up the game. Their outstanding achievements shape the tech landscape, proving that women are forces to be reckoned with in technology.

Women are taking the lead in Drupal organizations, such as the Drupal Diversity and Inclusion Group, which aims to foster a more diverse and inclusive community by promoting diversity in leadership, speaking opportunities, and events.

Drupal's got your back with the "Women in Drupal," formerly DrupalChix. This program hooks women with mentors, resources, and chances to connect. It's all about building a community where everyone's voice is heard.

Women in Drupal are not just part of the community but driving it to new heights. As we applaud their achievements, let's acknowledge that there's more ground to cover on the path to gender equality in tech.

Let's continue championing diversity, fostering inclusivity, and supporting one another. Now, look back at what we covered last week at The DropTimes.

Alka Elizabeth, a sub-editor, wrote about a Reddit discussion on Drupal Dilemmas, addressing issues and seeking improvements. I ran two interviews, the first with Andrew Berry, Director of Technology at Lullabot, sharing his insights from Evolve Drupal Toronto and contributions to the Drupal community. Read the complete interview here. The second one featured the API Client Initiative led by Brian Perry, core maintainer, aiming to provide a comprehensive solution for Drupal. Click here to read.

And for the Drupal community, here's some important news: Drupal core committers and the Drupal 10 readiness initiative seek your feedback. They're proposing a new working group focused on contributed modules where maintainers haven't updated to the next major Drupal version.

In noteworthy announcements, Tag1 Consulting celebrated a milestone with Nathaniel Catchpole's collaboration with Chrome for Developers, marking a crucial development for Drupal 10.2. Drupal core version 10.3.0 introduces a new access policy API for assigning permissions in various ways. Dave Long announced a significant change in Drupal core version 10.2.0, adding autocomplete attributes to login and password reset forms.

On the events front, Open Source Summit North America is accepting proposals for its April 16-18, 2024 event in Seattle. NERD Summit 2024 announced Dr. David Weinberger as the keynote speaker for March 8, 2024, and encourages session proposals before January 15, 2024. Rod Martin, Lead Trainer at OSTraining, will conduct an Absolute Beginner's Guide to Drupal training session on February 23, 2024, at Florida DrupalCamp.

Now, onto organization news—Bounteous is celebrating a big win at the MarCom Awards 2023, receiving the prestigious Gold Award. Kevin Montgomery of SearchStax published a guide highlighting the seamless collaboration between SearchStax Studio, Drupal CMS, and React. Tag1 Consulting's Michael Meyers and Janez Urevc conclude their podcast series, addressing migration cost complexities with Lucas Hedding. DevBranch, a team from Lutsk, Ukraine, reveals their extensive contributions to Drupal.org. Annertech introduces a 40% discount on vulnerability management for LocalGov Drupal.

Tutorials cover a range of Drupal topics: Saranya Ashokumar's D4Drupal video delves into automated testing in Drupal, Idroot provides a guide for installing Drupal on Fedora 39, Prerna Trimurty Infotech offers a step-by-step guide for upgrading Drupal websites and Drupalize.Me present tutorial videos covering essential concepts for module developers. Additionally, Ritvik Tak provides a comprehensive guide on setting up Drupal 8 multi-site environments using Lando.

We've also featured some insightful case studies. Droptica shares its experience developing the digital content platform EM360, showcasing the strategic use of Drupal for an innovative user-generated content hub in the IT sector. Druid presents a case study on renewing Veikkaus, the Finnish Gambling Website.

In book-related news, Smile has released a comprehensive white paper titled "Drupal in 2024," highlighting Drupal's global prominence as an Enterprise Content Management System (CMS). Joe Shindelar of Drupalize.me plans to release a curated "Hello, world" guide for developers in the Drupal community. AcroCommerce offers a practical integration guide, combining BigCommerce e-commerce capabilities with the versatility of Drupal CMS.

Switching to the security front, Achieve Internet issues an urgent compliance warning for Apigee Legacy Developer Portal users, stressing the critical importance of upgrading.

There are more stories to discover, but we must stop here due to space constraints. Keep enjoying your Drupal journey!

To get timely updates, follow us on LinkedIn, Twitter and Facebook.

Thank you,

Sincerely

Kazima Abbas
Sub-editor, TheDropTimes.

Categories: FLOSS Project Planets

LN Webworks: Drupal Decoupled and Headless: All you need to Know

Mon, 2023-12-11 04:30

Traditional Drupal websites leveraged Drupal for both content rendering on the front end and content management on the back end as it wasn’t possible to separate the two. This implies that Drupal significantly affected their styling which wasn’t always appreciated. However, today companies have the complete freedom to separate their site’s Drupal-based backend from the frontend through headless Drupal. 

This new and innovative Drupal decoupled approach has bestowed websites with an added layer of functionality and immense customization capabilities. Developers can freely opt for the front end of their choice and ensure that the site possesses the desired styling. The front end communicates with the backend through an API. This blog digs into Drupal's headless architecture in detail and discusses why it is so effective. 

Categories: FLOSS Project Planets

LostCarPark Drupal Blog: Drupal Advent Calendar day 11 - Volunteer Coordination

Mon, 2023-12-11 02:00
Drupal Advent Calendar day 11 - Volunteer Coordination james Mon, 12/11/2023 - 07:00

Welcome back to day 11 of the Drupal Advent Calendar. Behind today’s door Surabhi Gokte (surabhi-gokte) talks about her journey as volunteer coordinator.

Seven years ago, if someone said I would travel out of my country and be a super active community contributor, I’d have laughed it off. But things changed, and it wasn’t an overnight transformation. It required time, energy, money, patience, belief, and much more.

My journey began with volunteering at Drupal Camp Delhi in 2016, my first step into understanding the Drupal Community. Back then, I didn’t even know non-code contribution was a thing…

Tags
Categories: FLOSS Project Planets

LostCarPark Drupal Blog: Drupal Advent Calendar day 10 - Smart Date

Sun, 2023-12-10 02:00
Drupal Advent Calendar day 10 - Smart Date james Sun, 12/10/2023 - 07:00

It’s day 10 of the Drupal Advent Calendar, and behind today’s door we find the Smart Date module. We are joined by its creator, Martin Anderson-Clutz (mandclu), to tell us about it.

I was originally inspired to create Smart Date by my own frustration at how tedious it was to input dates and time in a Drupal website. I noticed that popular calendar applications used a variety of conventions to make the process simpler for content creators, for example:

  • Automatically set the end date and time based on the start, and a configurable duration
  • Default the start time to the start of the next hour…
Tags
Categories: FLOSS Project Planets

The Drop Times: Deep Dive into Drupal's API Client Initiative with Brian Perry

Sat, 2023-12-09 13:59
Dive into the heart of Drupal's innovation as we explore the API Client Initiative with Brian Perry. Discover the vision, goals, and insights driving the development of a robust JavaScript API client, poised to revolutionize the Drupal experience for developers.
Categories: FLOSS Project Planets

LostCarPark Drupal Blog: Drupal Advent Calendar day 9 - Backdrop

Sat, 2023-12-09 02:00
Drupal Advent Calendar day 9 - Backdrop james Sat, 12/09/2023 - 07:00

Welcome back to day 9 of the Drupal Advent Calendar. Today’s door takes us in a slightly different direction, as we join Jen Lampton (jenlampton) to tell us all about Backdrop CMS.

Backdrop CMS is the Drupal fork. Its goal is to provide a more affordable platform that’s easier to use, but without compromising on flexibility. On January 15th, it will have been 9 years since Backdrop’s initial release.

At its core, Backdrop has retained nearly all of the powerful functionalities of its predecessor, but the standard installation also includes more than 75 additional features that a modern website…

Tags
Categories: FLOSS Project Planets

Drupal Association blog: Meet Lenny Moskalyk, the first Ukrainian Board Member of the Drupal Association Board

Fri, 2023-12-08 12:02

We're thrilled to introduce Lenny Moskalyk, one of the newest members on the Drupal Association Board. Lenny is a Senior Project Manager at Cocomore and is involved in organizing DrupalCamp Kyiv. She's actively engaged in the Ukrainian Drupal Community and serves as an Advisory Board Member of DrupalCon Europe, among other contributions to various Drupal events. Recently, Lenny received the Women in Drupal 2023 award in the ‘Scale’ category, given to those who boost growth in Drupal—her accomplishments that led to this award represent the value of growth within the Drupal Community. 

Lenny recently joined the Drupal Association Board, and she shares her insights on this exciting journey:

What are you most excited about when it comes to joining the Drupal Association Board?
The opportunity to help and contribute back to the community in an efficient meaningful way.

What do you hope to accomplish during your time on the board?
I aim to build connections with underrepresented communities and make sure their voices are heard.

What specific skill or perspective do you contribute to the board?
Being the first Ukrainian on the Board, I am representing one of the biggest and most active communities in Europe. I have experience in organizing Drupal events of various scales and being an experienced project manager, I have excellent communication skills.

How has Drupal impacted your life or career?
I started to work with Drupal around 10 years ago and from the day the ideas of open source and support within the community won my heart. It inspired me to try myself in new roles, such as co-organizing DrupalCamp Kyiv. Through Drupal, I have discovered many new things about different cultures and nowadays wherever around the world I would go—I know for sure where to find like minded people :)

Tell us something that the Drupal community might not know about you.
I am a passionate traveler who recently added sailing skills! Another thing that brings me joy is cooking for my loved ones and sharing meals with them :)

Share a favorite quote or piece of advice that has inspired you.
“Fortune favors the brave.”

We can't wait to experience the incredible contributions Lenny will make during her time on the Drupal Association Board. Thank you, Lenny, for dedicating yourself to serving the Drupal community through your board work! Connect with Lenny on LinkedIn.

The Drupal Association Board of Directors comprises 12 members, with nine nominated for staggered 3-year terms, two elected by the Drupal Association members, and one reserved for the Drupal Project Founder, Dries Buyteart. The Board meets twice in person and four times virtually annually, overseeing policy establishment, executive director management, budget approval, financial reports, and participation in fundraising efforts.

Categories: FLOSS Project Planets

LostCarPark Drupal Blog: Drupal Advent Calendar day 8 - Disclosure Menu

Fri, 2023-12-08 02:00
Drupal Advent Calendar day 8 - Disclosure Menu james Fri, 12/08/2023 - 07:00

It’s time to open door number 8 of the Drupal Advent Calendar, and today we’re joined by Chris Wells (chrisfromredfin) to tell us about the Disclosure Menu module.

The importance of a seamless and inclusive website navigation cannot be overstated. Creating digital environments where everyone feels welcomed and capable is a central ethos in the Drupal community. And that’s why we were surprised that after spending so much time with menus over the years, there still wasn’t a truly accessible menu module available for Drupal.

The disclosure menu in action (with minimum theming)

Our narrative begins with a standard website component: a hoverable menu…

Tags
Categories: FLOSS Project Planets

Drupal Core News: Request for comment: Project Update Working Group

Fri, 2023-12-08 01:07

The Drupal core committers and Drupal 10 readiness initiative are seeking feedback on a proposed new working group. The group's mission is to focus on contributed modules where a maintainer has not updated to the next major Drupal version. This includes modules where the maintainer has requested assistance as well as modules where the maintainer is no longer active. This effort will benefit the entire Drupal ecosystem.

This group will have elevated privileges on Drupal.org like those that exist for the Security Team and Site Moderators.

Background

Currently the Project Update Bot generates automated compatibility patches for contributed projects. These patches are reviewed and tested by Drupal community members and then set to the "Reviewed & tested by the community" status.

However, for some modules, these patches are not committed in a timely fashion. This creates a barrier to updating to the next Drupal major version for sites that use this module.

There are existing workarounds. One is the Composer Lenient plugin which allows affected sites to install a patched version of the module. However, this is not a substitute for having a compatible version of the module.

Proposal

Establish a working group that has the ability to appoint its members as a temporary maintainer of a project. The only task of the temporary maintainer is to review, test and commit a patch or merge request that makes the module compatible with the new Drupal major version and optionally create a new release. The group will be able to take this action in the following circumstances:

  1. The project MUST have a canonical issue for updating to the next major version of Drupal. This issue MUST have a patch or merge request. The issue MUST be marked "Reviewed & tested by the community" and MUST NOT have had feedback from a module maintainer within the past two weeks. The following proposal refers to this as the contributed project issue.

  2. An attempt MUST have been made by members of the community to contact the module maintainers via their Drupal.org contact form. Record of this attempt MUST be recorded on the contributed project issue.

  3. An attempt SHOULD be made by members of the community to contact the module maintainers via a messaging platform such as the Drupal community Slack. Record of this attempt MUST be recorded on the contributed project issue.

  4. If there is no response from the module maintainer for seven (7) days, a member of the community MAY escalate the module to the Project Update Working Group.  To escalate a module, create a separate issue in the Project Update Working Group issue queue. This is termed the project update group issue. An attempt SHOULD be made to notify members of the Project Update working group via a messaging platform such as the Drupal community Slack.

  5. The Project Update Working Group MUST make a subsequent attempt to contact the module maintainers via their Drupal.org contact form. This communication MUST outline that failure to respond within seven (7) days may result in the Project update Working Group committing the contributed project issue on their behalf. Record of this contact MUST be recorded on the contributed project issue. Any communication between the Project Update Working Group and the module maintainers MUST be recorded on the project update group issue.

  6. When the seven-day period from item 5 has elapsed, the maintainer has had two weeks overall to respond. At this point, a member of the Project Update Working Group MUST decide on the next step. The next step is to either intervene or not. If the decision is to intervene, then the group must also decide if a tagged release is to be made as well as committing the change.  When making the decision the Project Update Working Group member MUST do the following.

    1. Take into consideration recent activity from the maintainer in the project.

    2. Take into consideration the age of the contributed project issue.

    3. Take into account the complexity of the patch/merge request. They must work to avoid regressions. The level of automated test coverage for the project SHOULD be used to inform the likelihood of a regression.

    4. Take into account the quality of the reviews.

    5. Take into account the possible lifespan of the module and the needs of the community. For example, if the module duplicates functionality added to core or another module, then they may decide not to intervene.

    6. Consider if the module is looking for new maintainers and if anyone has nominated themself for the role. The Project Update Working Group SHOULD favor supporting a new maintainer over intervention.

    7. The Project Update Working Group SHOULD aim to achieve compatibility with the major version in a backwards-compatible way.

  7. If a member of the Project Update Working Group decides to intervene and commit the patch, then the following occurs:

    1. A record of the decision MUST be recorded on the contributed project issue.

    2. The member of the Project Update Working Group MUST nominate to make the commit and/or release. Record of this nomination MUST occur on the contributed project issue.

    3. The member of the Project Update Working Group MUST make a temporary change to the project's maintainers to add themself as a maintainer. Record of this change MUST be made on the contributed project issue.

    4. The member of the Project Update Working Group with temporary maintainer access will then commit the  patch or merge request. This MUST be recorded on the contributed project issue

    5. The member of the Project Update Working Group MUST acknowledge that the commit was made on the contributed project issue.

    6. If it was decided that a release should be made, a member of the Project Update working group will create a tag and add a release node for the tag on Drupal.org. The member making this action MUST make a record of this on the contributed project issue. The release MUST follow semantic versioning rules for backwards compatibility. The member SHOULD strive to make a new minor version to allow sites to install a compatible version without updating the major version of Drupal.

    7. If the module maintainer has not requested assistance from The Project Update group, a member of the Project Update Working Group MUST update the project node on Drupal.org to change it to 'No further development'. If the module has opted in to Security team coverage, the member of the Project Update group MAY opt the module out of this coverage.

    8. Any member of the Project Update Working Group MUST then mark the original contributed project issue as fixed. This action SHOULD NOT prevent opening of new issues for the project for major version compatibility.

    9. A member of the Project Update Working Group MUST revoke the temporary maintainer rights within fourteen (14 days). Record of this change MUST be recorded on the contributed project issue. 

    10. If the module was marked 'No further development' and if no such issue exists for the contributed project - a member of the Project Update Working Group MUST open a new issue in the project's queue seeking a new maintainer.

    11. If additional compatibility issues are found between the module and the next major version of Drupal, the process above repeats.

Working group membership

The working group will comprise community members who self-nominate. Interested community members must receive two seconding recommendations from other community members. Nomination and seconding will occur publicly on Drupal.org in the Project Update Working Group issue queue. Community members will be able to share their thoughts or concerns on the nominees' applications. Concerns relating to conduct of members of the group MUST follow Drupal's standard Community Working Group processes.

The initial membership of the group will comprise at least five (5) individuals. Members of the group should have a record of maintaining core or contributed projects and have the git-vetted role on Drupal.org. In addition the group may contain provisional members. These members will not have the ability to change project maintainers and will require the support of a full member to carry out their duties.

The initial make up of the group will be vetted by the core committer team and security team. Subsequent appointments will be vetted by the Project Update Working Group with a fourteen day period for veto from the security team and/or core committers.

Membership of the group is for a single major update. For example, from Drupal 10 to Drupal 11. The first major update in which the group is active will be from Drupal 10 to 11. At the end of each major cycle, members can opt to renew their membership for the next major update cycle. As with the original nomination, this process will happen in public and require two seconding recommendations from the community. 

Additional lifecycle option

To complement this process, it is proposed that a new Abandoned lifecycle status is added for project info files.

If this is successful, the following changes will be made;

  1. The process at (6) above will be amended such that the module's info file is updated to set the lifecycle value to 'abandoned'.

  2. A lifecycle link is added that points to the issue in the project's queue where a new maintainer is sought.

Comment period

Community feedback is sought on the proposed process. Please use this issue to add your input. The feedback period will last until Friday January 12th 2024.

Categories: FLOSS Project Planets

Promet Source: Exploring AI for Drupal Development

Thu, 2023-12-07 14:36
While 2023 appears to be the year that Artificial Intelligence emerged from the shadows and into the mainstream, the potential of AI has barely scratched the surface. AI is here and its impact on life and work is developing at an exponential pace.  As this disruptive technology is generating quick answers, streamlining processes, and creating vast new efficiencies, hundreds of possibilities for AI – ranging from healthcare diagnoses, to cybersecurity threat detection, content creation, software development, and many, many more – are taking shape.
Categories: FLOSS Project Planets

Promet Source: Exploring AI for Drupal Development and More

Thu, 2023-12-07 11:01
While 2023 appears to be the year that Artificial Intelligence emerged from the shadows and into the mainstream, the potential of AI has barely scratched the surface. AI is here and its impact on life and work is developing at an exponential pace.  As this disruptive technology is generating quick answers, streamlining processes, and creating vast new efficiencies, hundreds of possibilities for AI – ranging from healthcare diagnoses, to cybersecurity threat detection, content creation, software development, and many, many more – are taking shape.
Categories: FLOSS Project Planets

Evolving Web: Drupal Theming Do's and Don'ts

Thu, 2023-12-07 08:27

Are you a Drupal enthusiast looking to take your theming game to the next level? Well, you're in for a treat! In this blog post, we're going to dive into some essential best practices for Drupal theming.

View Modes

❌Don’t use the same view mode for everything

✅Do use view modes for unique content displays

View modes are an invaluable tool when it comes to theming in Drupal. They allow you to create unique presentations for your content, tailored to specific use cases. Here's why you should embrace them:

Tailored content display. View modes allow you to customize how your content appears in different contexts. You can make each one look just right, whether it's a teaser on a list page or a full content view.

Field management and formatting. Tired of displaying all the fields, even when you only need a few? View modes let you selectively show or hide specific fields, ensuring a clutter-free design. What’s more, view modes enable you to apply different formatters to each field.

Control referenced entities. View modes are also incredibly useful when displaying referenced entities as you can customize how a referenced entity appears per view mode.

Custom templates. Having different view modes also allows you to create specific templates that you can easily override and customize to your liking.

Some common examples of custom view modes:

  • Search result – used when the content is displayed as part of a search result
  • Featured – used when displaying the content in a more prominent way
  • Embedded – used when embedding the content inside a rich-text editor

Here you can see the recipe content type with multiple view modes configured.

Printing Field Values

❌Don’t access entity fields directly

✅Do use the content object when printing field values

 

Accessing and printing out entity fields directly places the burden of displaying fields on you and your code further increasing technical debt. So avoid printing entity fields like this:

{{node.field_example.value}}

Instead, use the content object:

{{content.field_example}}

Using the content object means you'll benefit from field widgets and formatters. There are tons of contrib modules that provide additional field widgets and formatters that you can use. 

The content object also allows you to take advantage of field preprocess functions as well as field templates. These are out-of-the-box theming helpers that allow you to fine-tune the appearance of your fields. This approach is very close to Drupal standards.

However, there's an exception to this rule. You may access entity fields directly when checking raw values (like lists or keys) or when you need to verify the truthiness of a field. In these specific cases, it's acceptable to access the fields directly from the entity object instead of the content object. See the sections on empty fields and ternary operations below for tips on how to check raw values.

Beyond Content Fields

❌Don’t overfocus on fields and forget the rest of your content

✅Do pay attention to internal data and use the without Twig filter

It’s normal to find yourself printing the content fields individually, but it’s essential not to overlook the rest of your content. Here’s what to keep in mind:

Ensure processing of important internal data. Your content may contain essential internal data, such as hidden form tokens or cache tags.

Customize your view mode to hide fields. One of the strengths of view modes is their ability to hide specific fields. By leveraging view modes effectively, you can ensure that certain fields are hidden when they are not needed in a particular context.

Use the without Twig filter. To print the rest of the content effortlessly, you can make use of the without Twig filter. This filter allows you to exclude specific fields from the rendering, ensuring that only the necessary content is displayed.

// Print content fields individually. {{content.field_foo}} {{content.field_bar}} // But don't forget to "flush" the rest of the content. {{content|without('field_foo','field_bar')}}Clean, Lean Templates

❌Don’t allow clutter and "Drupalisms" to build up

✅Do use contrib modules to tidy up your code 

The Fences and No Markup modules can help you achieve more concise and readable code for cleaner, more efficient templates.

These modules allow you to control the HTML markup and structure of your content without creating unnecessary clutter. Your templates will be easier to maintain and understand as a result.

They also allow for more standardized markup that’s easier to style with CSS. Drupal generates a lot of markup by default, often containing "Drupalisms"—patterns and classes that are specific to the Drupal ecosystem. Fences and No Markup enable you to strip away these Drupal-specific elements.

 

Remove wrapper elements with the Fences module or completely remove all default markups with the No Markup module.

Empty Fields

❌Don’t rely on rendering functions to tell you if a field is empty

✅Do check the entity property directly

One area that often goes overlooked is handling empty fields. It’s best practice to check the entity property directly instead of relying on rendering functions to determine if a field is empty. By accessing the raw data, you can efficiently assess whether the field contains content without triggering unnecessary rendering processes.

If you have to render a field before checking if it's empty, do so judiciously. Render the field once and store the result. Then perform your checks on the stored value. This approach minimizes the performance impact associated with repeated rendering calls.

Consider the following example:

{%ifcontent.field_name|renderisnotempty%} {{content.field_name}} {%endif%}

This can be optimized as follows:

{%ifcontent.field_exampleisnotempty%} {%ifnode.field_example.value%} {%ifnotnode.field_example.isEmpty()%}

Or, if rendering is necessary, do it once and test:

{%setrendered_field=content.field_example|render|trim%} {%ifrendered_field%} {{rendered_field}} {%endif%}Ternary Operations

✅Do use ternary operations to make your code look concise

❌Don’t use them in situations where they might compromise code readability

Simplicity often leads to elegance. One way to achieve a cleaner and more concise codebase is by embracing Twig ternary operations. Here are some practical examples:

Example A: If foo, echo “yes” else echo “no”:

{{foo?'yes':'no'}}

Example B: If foo, echo it, else echo “no”:

{{foo?:'no'}}

or

{{foo?foo:'no'}}

Example C: If foo, echo “yes”, else echo nothing:

{{foo?'yes'}}

or

{{foo?'yes':''}}

Example D: If foo is defined and not null, echo it, “no” otherwise:

{{foo??'no'}}

Example E: If foo is defined (empty values also count), echo it, “no” otherwise:

{{foo|default('no')}}

While Twig ternary operations are excellent for simplifying straightforward conditions, it's essential to use them judiciously. Reserve their use for situations where the conditions are concise and don't compromise code readability.

Twig Features

❌Don’t allow regular PHP code to become bloated and unwieldy

✅Do use Twig to create efficient and maintainable templates

Twig compiles templates down to plain optimized PHP code. Maximizing the potential of Twig goes a long way in creating efficient and maintainable templates. With single directory components (SDCs) becoming part of Drupal core, familiarizing yourself with Twig, and its built-in functions, is now more practical than ever.

Include: Insert Static Template Content

The include statement allows you to insert static template content from another file into your current template. This can be especially handy when you have reusable components or snippets of code that you want to include across multiple templates. 

For example:

{#Includeheadercontentfromaseparatetemplatefile#} {%include'themes/my_theme/templates/header.html.twig'%}Extends: Template Inheritance

The extends statement is the foundation of template inheritance. It enables you to create a base template with common elements and then extend or override specific sections in child templates. This promotes consistency and reduces redundancy in your theming. Some examples are below.

Base template: base.html.twig

{%blockheader%}{%endblock%} {%blockcontent%}{%endblock%}

Child template: child.html.twig:

{%extends'base.html.twig'%} {%blockheader%} Extendedblock {%endblock%} {%blockcontent%} Thisblockisextended.

{%endblock%}Use: Import Blocks Without Inheriting Structure

The use statement allows you to import blocks from another template without inheriting its entire structure. This can be useful when you want to reuse specific blocks without committing to the entire template. Example:

Block library: block-library.html.twig

{%blockheader%} Product Features Marketplace Company {%endblock%} {%blockfooter%}

Copyright©MyWebsite2023.Allrightsreserved.

{%endblock%} {%blocksidebar%} Thisisasidebar {%endblock%}Embed: Create Reusable Self-Contained Components

The embed statement is similar to include but with a crucial difference. It allows you to create self-contained components that encapsulate their own logic and styling. This promotes modularity and makes your templates more maintainable. Some examples are below:

Person card: person-card.html.twig

{%blockperson%}

{%blockname%}Name{%endblock%}

{%blockposition%}Position{%endblock%}

{%endblock%} People list: people.html.twig {%embed'person-card.html.twig'%} {%blockname%} BubblesMcFuzzball {%endblock%} {%blockposition%} ChiefBubbleologist {%endblock%} {%endembed%} {%embed'person-card.html.twig'%} {%blockname%} SirReginaldFluffernutter {%endblock%} {%blockposition%} DirectorofSnuggles {%endblock%} {%endembed%}

Section: section.html.twig

{%use'block-library.html.twig'%} {{block('header')}} Macro: Create Reusable, Parameterized Code Chunks

The macro statement enables you to define reusable, parameterized code chunks. This is particularly useful when you need to repeat a specific operation with variations across your templates.

Button: button.html.twig

{%macrobutton(text,url,color='indigo')%} {{text}} {%endmacro%}

Form actions: form-actions.html.twig

{%import'button.html.twig'asbuttons%} {{buttons.button('PrimaryButton','#','indigo')}} {{buttons.button('SecondaryButton','#','zinc')}} The Final Word: Simplicity is Key

From the flexibility of view modes to the power of Twig features, each technique that I’ve covered in this article will contribute to cleaner, more maintainable templates. Just remember that simplicity is key—the goal is to strike a balance between conciseness and clarity.

Happy theming!

//--> //--> //-->

+ more awesome articles by Evolving Web
Categories: FLOSS Project Planets

The Drop Times: Drupal: A Digital Public Good - Insights from Andrew Berry

Thu, 2023-12-07 05:34
Get ready to embark on a tech journey with Andrew Berry, the Director of Technology at Lullabot. In an exclusive interview with The Drop Times, Andrew shares anecdotes from his session at Evolve Drupal, spills the beans on his fascinating Drupal journey, and explores the distinctive community spirit that propels Drupal forward.
Categories: FLOSS Project Planets

LostCarPark Drupal Blog: Drupal Advent Calendar day 7 - Extra Field

Thu, 2023-12-07 02:00
Drupal Advent Calendar day 7 - Extra Field james Thu, 12/07/2023 - 07:00

Welcome back to the Drupal Advent Calendar, and we’re rounding out the first week with the help of Rodrigo Aguilera (rodrigoaguilera), who’s telling us about the Extra Field module.

My choice for the Drupal advent calendar is Extra field because it is a not-so-popular module that helps me in many projects. It falls into a category that I call “Developer little helpers” since it doesn’t provide any immediate interface or functionality but it makes my life a little bit easier.

I like to keep the different representations of entities in display modes and keep the configurability that Drupal offers…

Tags
Categories: FLOSS Project Planets

Drupal Association blog: Transitioning from Drupal 7: What's next for your website?

Thu, 2023-12-07 01:39

Here's the next part of our ongoing series dedicated to assisting Drupal 7 site owners in upgrading their websites to Drupal 10. There are many great reasons to upgrade. The modern Drupal offers powerful features for content editors including: customizable editorial workflows, a layout builder for your landing pages, a media library that makes managing and reusing media easier than ever, and more. Developers can leverage the most of these advancements.

In our previous blog post, we discussed using our questionnaire to develop a plan, understanding your budget, and deciding whether to work with a certified partner from our list or take the DIY approach for your migration. As we get closer to the start of 2024 and to Drupal 7 End of Life, it's crucial to consider the next phase. Now, you need to secure your website's future but also start to map your information architecture and enhance your content strategy. In this blog post, we'll explore what that means and why these steps are crucial as you prepare to transition away from Drupal 7.

Understanding Information Architecture and Content Strategy

At its core, these steps are vital to ensure a smooth transition to a new version. Mapping information architecture involves creating a blueprint of your website, showcasing where every piece of content is located and how it's interconnected, along with the key content types, views, and taxonomies crucial to your site. This is crucial because when you transition away from Drupal 7 to a new version, having a clear plan ensures that your website's structure remains organized. Such clarity helps prevent issues like data loss, broken links, and confusion for your website visitors.

Drupal offers tools and features empowering site builders and developers to create and manage a structured website tailored to your specific needs.

Additionally, when you assess your content strategy, you're essentially conducting a thorough review of the quality, relevance, and overall effectiveness of the content on your website. This is crucial during migration as it ensures your content remains valuable, fits the new platform's goals, improves user experience, and maintains or boosts SEO rankings. This preparation is vital for a smooth transition and to maintain the integrity of your content in the new setting.

To learn more about information architecture, explore the information architecture guide. For insights into content strategy, refer to this content strategy guide. For a comprehensive checklist when launching a website, visit the major version upgrade documentation.

Here are some recent sessions from DrupalCon worth exploring:

What does End of Life mean for you?

In software terms, End of Life means that the version of that software no longer receives feature updates, bug fixes, or security releases. This last point is the most important. If a security vulnerability is discovered after the end of life date, it may be publicly disclosed, and you will be unable to update your site to protect against the issue. For this reason, we recommend beginning to plan your migration now. 

Whether you want to take advantage of new functionalities with Drupal 10 or opt for another option, we’re here to support you. 

Visit our resource center to migrate from Drupal 7 now, and stay tuned for more blogs in our Drupal 7 End of Life series!

Categories: FLOSS Project Planets

LN Webworks: Drupal Coding Standards with Git Hooks: All You Need To Know

Thu, 2023-12-07 00:31

Think of good code like a well-put-together puzzle—it's strong, looks good, and is easy to tweak. When you're coding with a team or diving into projects like Drupal, sticking to coding standards is a big deal. That's where Git Hooks come in! 

Git Hooks provides a simple and automated way to guarantee that your code consistently adheres to Drupal’s coding standards. By incorporating Drupal Coding Standards with Git Hooks, developers can effortlessly commit and push code that aligns with the community's guidelines. 

Let’s dive deeper into the world of Git Hooks to understand how they work and put them into action for smoother and more standardized coding practices.

The Significance of Drupal Coding Standards

Drupal's coding standards encompass a set of guidelines for writing consistent, well-structured, and maintainable code. These standards cover various aspects of code development, including:

Categories: FLOSS Project Planets

Lullabot: Managing Software Updates for Hundreds of Websites

Wed, 2023-12-06 17:09

Manually maintaining a Drupal website is time-consuming, especially for a small team with other priorities, like delivering new features and fixing bugs. When the Drupal Security team announces that there is a new security update, this requires one or more members of the development team to:

Categories: FLOSS Project Planets

ImageX: Tailored Admin Experiences for All Users with The Dashboard Initiative in Drupal

Wed, 2023-12-06 12:59

Authored by: Nadiia Nykolaichuk

 

When logging in to a Drupal website, we all have different goals based on our specific responsibilities. Could each of us have a seamless journey through the admin UI, with no need for any extra steps, and with all the most relevant shortcuts at our fingertips? 

Categories: FLOSS Project Planets

Four Kitchens: Now’s the time to plan your migration to Drupal 10

Wed, 2023-12-06 11:27

Laura Johnson

Senior Engineer

Primarily a backend developer, Laura also loves adding new cross-disciplinary skills to her collection, such as working with themes and frontend frameworks.

January 1, 1970

If your organization is still using Drupal 7 or later, migrating to an up-to-date platform for your website has been looming like a weight on your shoulders. The move to Drupal 10 isn’t easy. It requires a migration of your site and a full redesign to take advantage of the new tools the latest version offers.

Not only do you need someone to write that migration, but you also need to secure the budget to undertake a project like this. As you wait for the right time to get started, the weight of the deadline to begin your migration to Drupal 10 has only grown heavier. After multiple extensions, the Drupal community has set January 5, 2025 as the final end-of-life date for Drupal 7.

What does that mean for your organization? On the one hand, you now have just over a year to start planning a migration before your site loses crucial support. But on the other hand, as many organizations like yours face a similar deadline, you can’t afford to wait much longer. The time to make the move to Drupal 10 is now.

Why you need to start planning for a Drupal 10 migration

If you’ve fallen behind in migrating your site from Drupal 7, you’re not alone. According to the Drupal community, more than 350,000 projects still use that version of the platform as of November 2023 — one-quarter of all Drupal sites.

As a result, you aren’t just facing a hard deadline to relaunch your new site as January 2025 grows closer. You’re also competing with a vast number of organizations just like yours who need to coordinate the same migration with a web development agency partner. Given that it takes an average of six months to complete the sales process to get started on a Drupal 7 migration, you’re already at risk of missing the deadline if you have not yet contacted an agency.

The longer you wait, the less likely you are to find a team with availability to work with you on a migration plan and website redesign before Drupal 7 reaches end-of-life. And, given the stakes involved, your organization can’t afford the risks of sticking on a platform without the vital benefits of ongoing support.

What your organization loses when Drupal 7 reaches end-of-life

Drupal 7 will reach its end of life 14 years after its initial release. If you’re still on the platform, your website will remain accessible after January 5, 2025. However, it will no longer receive feature updates, bug fixes, or security releases from the Drupal community.

This last detail is most critical to your organization. Any security issues discovered after January 2025 may be publicly disclosed, but Drupal will no longer provide any necessary updates. Prior to the announcement of this final extension for Drupal 7, your organization had the option of paying for extended support. But that is no longer the case.

When you work with the right agency partner, you can create a migration plan that will keep your website secure. Fortunately, your organization will be able to better manage ‌site security after the migration is complete. But that’s just one of the advantages made possible by getting your organization started with Drupal 10.

Drupal 10 offers dramatic advantages after migration

Trusting your site with the legacy code of Drupal 7 doesn’t just expose your organization to poor security. It prevents you from taking advantage of dramatic improvements for your site’s users and content editors.

Improved website speed and SEO performance

Fundamentally, your Drupal 10 website will run faster. Dynamic caching reduces page load times by invalidating only the content that has changed. Instead of needing to reload your entire page after a set amount of time, your cache can just reload the block with new information.

Drupal 10 also marks the end of Drupal 7’s jQuery. A large JavaScript library, jQuery was a powerful tool, but modern browsers perform many of the same functions. The up-to-date JavaScript used by Drupal 10 also decreases page load times.

Drupal 10 also supports new formats such as schema.org, Open Graph, and JSON-LD, which increase conversions from search engines. Plus, Drupal 10 supports advanced accessibility features that improve WCAG compliance and further improve SEO rankings.

Better site security and reduced maintenance costs

Drupal 10 improves your site security by including up-to-date protocols and dependencies such as PHP 8, Symfony 6, and CKEditor 5. As earlier versions of these dependencies reach end-of-life, they may be exposed to unpatched security vulnerabilities. Migrating to Drupal 10 avoids delays in getting critical security patches applied to your site.

One of Drupal’s major advantages as an open-source platform is the community’s Security Team, which delivers security advisories and provides guidance to contributed module maintainers on how to resolve potential vulnerabilities. Providing continued support from the community Security Team for all of your site’s contributed modules beyond the upgrade deadline is critical.

Improved content editing experience and efficiency

Drupal’s out-of-the-box CMS experience has always been limited. With Drupal 10, your site editors benefit from the Claro theme, which makes Drupal much easier to use. New image tools and an updated media library also enable better organization of your site’s assets.

Drupal 10 also includes the JavaScript text editor CKEditor 5, which further simplifies content creation and its accessibility. In addition, the platform offers enhanced translation capabilities in multiple languages, which enables your organization to reach a wider audience than ever.

Don’t wait until an emergency before moving to Drupal 10

Upgrading your site from Drupal 7 to Drupal 10 isn’t quick or easy. That’s why so many organizations like yours have been putting off the migration. But the sooner you start preparing your site for the future, the sooner you can take advantage of all Drupal 10 has to offer.

Better still, you gain the added peace of mind knowing your site won’t be exposed to critical vulnerabilities. And you don’t have to start planning on your own. With the right team of Drupal experts, you can make a plan to ensure your site remains stable and secure moving forward.

If this sounds like a plan that will help your organization move forward, we should talk.

The post Now’s the time to plan your migration to Drupal 10 appeared first on Four Kitchens.

Categories: FLOSS Project Planets

Pages