Development News

Community Working Group posts: Code of Conduct team update: June 1, 2022

Main Drupal Feed - Thu, 06/02/2022 - 18:10

As previously reported, the Community Health Team has started to have regular, bi-weekly meetings in an effort to develop and update the Code of Conduct for the Drupal community.

Community Health Team members present at this week's meeting were

Our first task was to review our project Miro board (a fancy virtual white board); further refining the tasks and their placement (categories).

We then had a discussion about how best to expand the initial team while still keeping focus. We plan on inviting more community members to participate on specific tasks (including reviewing milestones along the way) at different points in the process in an effort to find and fix potential issues as early as possible. Our discussion led to an initial list of groups we plan on inviting to this process at various stages:

  • Security working group
  • Event organizers working group
  • Drupal Diversity & Inclusion
  • Core committers
  • Top Drupal contributors
  • Top contrib project maintainers
  • Community accessibility experts
  • Various geographic-based groups

We are all in agreement that including non-United States and non-Western European community members as part of this process is a high priority for us. Identifying and contacting community members willing to help will be an early task of ours. This work will begin during the next two weeks.

Our second task for the next two weeks will be to start the process of individually reviewing our existing Code of Conduct as well as those of other communities and sharing relevant feedback at our next meeting.

If you have suggestions for who should be involved in the overall process of updating our Code of Conduct, please let us know in the comments below.

WPTavern: WP Engine Acquires 5 Plugins From Delicious Brains

Wordpress Planet - Thu, 06/02/2022 - 15:04

Delicious Brains, a WordPress product company founded in 2012 by Brad Touesnard, has sold five of its plugins to WP Engine: Advanced Custom Fields (ACF), WP Migrate, WP Offload Media, WP Offload SES, and Better Search Replace.

Over the past four years, WP Engine has been scooping up developer tools through acquisitions, including StudioPress and the Genesis Framework (2018), Flywheel and its Local development tool (2019) and the Frost block theme (2021). The five Delicious Brains plugins, which are active on more than four million WordPress sites, greatly expand WP Engine’s reach into the developer market. ACF, which allows developers to control WordPress edit screens and custom field data, accounts for two million users.

Delicious Brains will continue with its SpinupWP product which allows developers to spin up a server and manage it via a cloud-based control panel.

“What if I could exit the plugin side of the business but keep SpinupWP and continue on with that project and its team?” Touesnard said in a post explaining why he sold the plugins. “The more I thought about it, the more I liked the idea. 

“In the previous 18 months, we had gone from 10 people to 34. I was now a manager of managers and also directing marketing – not my strongest areas and I was stretched pretty thin so not doing my best work. At the same time, I wasn’t spending nearly as much time on SpinupWP as I would have liked.”

Touesnard pitched the idea of selling the plugins to his connections at WP Engine and they were enthusiastic. The company is also acqui-hiring several members of the Delcious Brains team to continue supporting the products.

“I’ve often said that if for some reason I couldn’t work for a month or more that Iain Poulson would step up and keep Delicious Brains running and thriving without me,” Touesnard said. “He has been with Delicious Brains since the early days, has worked across all the products, and makes sure that things get done that need doing. I’m very happy to say that Iain will be joining WP Engine, overseeing the continued development of ACF. Matt Shaw and Liam Gladdy will continue their work as developers on ACF as well.

“Although Kevin Hoffman only joined us last August, he has made a huge impact on WP Migrate and Better Search Replace as product manager. I’m very pleased to say that he will continue that work partnering with Phil Webster and Ahmed Hussein. He will also continue working with Ian Jones and Erik Torsner on WP Offload Media and WP Offload SES.”

Touesnard said support teams for each product will remain in place and the plugins’ developers will continue helping out in support as issues are escalated to them.

WP Engine has promised to honor ACF Pro lifetime licenses and Touesnard said the company “has no plans to change subscription prices for any of the plugins for the foreseeable future.”

Drupal Association blog: Honoring and Celebrating our DrupalCon Portland 2022 Scholars

Main Drupal Feed - Thu, 06/02/2022 - 13:29

Recently at DrupalCon Portland 2022, I was honored to share space with our amazing scholarship recipients at our Scholarship Breakfast and throughout the rest of the week. This community building felt particularly meaningful, as it was our first year gathering in person again since 2019 and for many of our scholars, it was their first DrupalCon ever! 

The DrupalCon scholarship program exists to decrease barriers-to-entry for marginalized people in the Drupal community and contributing to the project. Scholarship programs like these are not charity, they are providing the resources for historically oppressed folks in our society and community who deserve as much success and access as those of privileged identity. 

In addition to the 2019 Driesnote, we were grateful to host industry leaders at DrupalCon Portland 2022 to discuss inequity in Open Source. From the background and framework of understanding to actionable progress that can be made, I feel confident and energized that the Drupal community is on the right track. 

A reality for marginalized folks worldwide is that not all scholarship recipients can be featured publicly. There are very real risks to living in our truth publicly, and I take the safety and privacy of our scholars very seriously. Consent and personal autonomy are everything! 

Of our scholars who consented to being featured, I asked if they’d like to share their experiences with us, and 3 of them have graciously agreed. All 3 of them are some of the warmest folks I’ve ever spent time with as well as being powerhouse professionals doing incredible work in Drupal. We are all made better by being in community with them.

Kwame “pearcraft” Puryear 

How he got into Drupal (and why he stayed) 

I started following the Drupal community fifteen years ago, after hearing about it on the Lullabot podcast. The cooperative nature of the Drupal community stood out to me - in fact, it aligned well with the principles of Kwanzaa that I had learned from my family throughout my life.

His experience at DrupalCon Portland 2022 

My mentor, Leslie Glynn gave me excellent advice on how to get the most from DrupalCon. My favorite moment was Dries promoting my volunteer project (Project Browser) as a major feature of Drupal 11! My favorite session was Dori Kelner's "You Are Not A Fraud". Its focus is on Imposterism in general and how it’s actually MORE devastating for talented people. It also highlighted how it specifically affects disadvantaged groups of people.

Allison Lu 

How she got into Drupal (and why she stayed)

I worked with Drupal 8 while building out UCLA's Undergraduate Admission website. Currently, I’m working with Drupal 9 on VA modernization. I want to meet more women in tech! I like digital accessibility, and connection.

Her experience at DrupalCon Portland 2022

One piece of advice from my mentor (Em Nouveau) that stuck with me was to go to the Birds of a Feather sessions, since all talks are recorded but these organic small group discussions weren't. I joined the Drupal Diversity and Inclusion (DDI) table, where I felt truly welcomed as a different and beginner Drupal developer. Along with this experience, the warmth of the Drupal Association folks and insight of the diversity keynotes were so validating, healing, and empowering. 

Lapedra Tolson 

How she got into Drupal (and why she stayed) 

Federal agencies use Drupal for their content management systems a lot. I founded Friends From The City because I wanted to be the change I wanted to see in the world. Friends From The City is a digital services firm that partners with federal and state agencies to modernize their legacy systems, and Drupal is heavily used. We often try to design a bespoke user experience for authors and editors rather than using out-of-the-box templates, specifically at the U.S. Department of Veteran Affairs.

Her experience at DrupalCon Portland 2022 

DrupalCon Portland 2022 was an amazing conference. Von Eaton is an awesome person who is welcoming and affirming. After the scholars' breakfast (which was delicious, btw) and the sessions, I felt inspired to learn more about Drupal, particularly as the founder of a design firm. In addition to the informative sessions, meeting new people at the various networking events was also a pleasant experience. I hope to attend more DrupalCons in the future and continue to learn about this awesome platform and community. Thank you for welcoming us!

I also want to lift up our other scholarship recipients who consented to being featured publicly: 

Thank you so much to all of you for choosing to spend your week at DrupalCon Portland 2022 and for all you do to make an impact on those around you. I am deeply grateful to know you all, and I look forward to continuing to support you in your Drupal journeys. 

If you’d like to read more about Diversity, Equity, and Inclusion trends in open source, here are some great scholarly articles: 

mark.ie: Creating a Drupal Field Group Programmatically

Main Drupal Feed - Thu, 06/02/2022 - 13:26

How to create a Drupal field group programatically in Drupal 8, 9, 10, etc.

mark.ie: Creating a Drupal Field Group Programmatically

Main Drupal Feed - Thu, 06/02/2022 - 13:26

How to create a Drupal field group programatically in Drupal 8, 9, 10, etc.

mark.ie: Creating a Drupal Field Group Programmatically

Main Drupal Feed - Thu, 06/02/2022 - 13:26

How to create a Drupal field group programatically in Drupal 8, 9, 10, etc.

Droptica: Enhanced Drupal templates. Review of the Twig Tweak Module

Main Drupal Feed - Thu, 06/02/2022 - 12:23

When using any kind of solution, we usually encounter the need to create generic support functions. A similar situation occurs when working with templates in Drupal 9. If you’ve ever created custom code to display a block, view, or entities in a Drupal 9 template, and are interested in ready-made and tested solution, this article is for you. We’ll show you the Twig Tweak module, which provides a number of support functions.

Twig and Drupal

Twig is a template engine for PHP, released in 2009. It’s constantly developed. As at the date of writing this article, the latest version is 3.4.1. Twig is an integral part of the Symfony framework, and thus – also of Drupal 9. Drupal in its own way implements certain concepts, such as entities, blocks, and views. To build the final HTML from the so-called render arrays, Drupal uses internal classes designed for this purpose. Twig, however, doesn't know by default how they work. Because of this, it’s natively impossible to, for example, render a block or view with any parameters and in any place just by using the Twig engine. To make such an operation possible, the Drupal community has created the Twig Tweak module, which introduces a substantial list of Twig extensions addressing the most common Drupal-specific problems.

Twig Tweak module

The module was released on 3 January 2016, and its latest update was on 15 April 2022. Twig Tweak has an older version that is compatible with Drupal 8 and 9, and a newer one that requires Drupal 9. For obvious reasons (using Symfony from version 8), the module doesn't have a Drupal 7 version.

The Twig Tweak module provides a collection of extensions for Twig that allow you to, for example, render views, blocks, regions, entities, fields, menus, forms, tokens, and more. The full list of possibilities is provided in the Twig Tweak cheat sheet prepared by the authors.

Twig Tweak is currently used by over 100 thousand websites. The latest 3.x version is gaining in popularity over the older 2.x version, which is experiencing slight but continuous drops.

 

Source: Drupal.org

The creator and the main person maintaining the module is the user Chi. Due to the popularity of the module, the full list of people who contributed to its development is too extensive to be quoted.

Installation

The Twig Tweak module's installation is standard.

composer require drupal/twig_tweak drush pm:enable twig_tweak

The module has no dependencies other than Drupal Core and also doesn't provide custom permissions.

There is one configuration option - twig_tweak_enable_php_filter - which is set in the settings.php file. It is set to TRUE / FALSE and is FALSE by default. Enabling this option adds the possibility of using pure PHP in Twig. The option is turned off by default, possibly for security reasons.

How to use Twig Tweak

After installing the module, we get access to the following functions:

drupal_view

Renders the provided view. Example: 

{{ drupal_view(‘view_id’, 'view_display_id’) }}

drupal_view_result

Renders only the result of the provided view. Example: 

{{ drupal_view_result(‘view_id’, 'view_display_id’) }}

drupal_block

Renders the provided block. Example:

{# Block with default configuration. #} {{ drupal_block('block_id') }} {# Block with custom configuration. #} {{ drupal_block('block_id', {config_id: 'foo', another_config_id: false}) }} {# Block without block.html.twig theming. #} {{ drupal_block('block_id', wrapper=false) }}

drupal_region

Renders the provided region. Example:

{# Foo region of the default theme. #} {{ drupal_region(‘foo’) }} {# Foo region of Bartik theme. #} {{ drupal_region('foo', 'bartik') }} Other functions in Twig Tweak

Let's take a look at other options available in this module:

drupal_entity - renders entities,

drupal_entity_form - renders entity form,

drupal_field - renders field,

drupal_menu - renders menu,

drupal_form - renders form,

drupal_image - renders image,

drupal_token - replaces token,

drupal_config - renders configurations,

drupal_dump / dd - renders a readable version of the variable's content (helpful for debugging),

drupal_title - renders the title of the current page,

drupal_url - renders URL,

drupal_link - renders link,

drupal_messages - renders status messages,

drupal_breadcrumb - renders breadcrumbs,

drupal_breakpoint - triggers the Xdebug's breakpoint,

drupal_contextual_links - renders contextual links.

Filters in the Twig Tweak module

Now we'll take a look at the filters available in the tool:

token_replace - replaces token,

preg_replace - enables using the preg_replace function in Twig,

image_style - applies the given image style,

transliterate - transliterates text from Unicode to US-ASCII,

check_markup - filters text based on the text style specified in the system,

format_size - formats the given number of bytes into a character representation with a multiple suffix,

truncate - limits the given text to the chosen number of characters,

view - returns the render array for the given entity or field,

with - works inversely to the core's without filter,

children - used in multiple-selection fields to get a list of items,

file_uri - returns the URI of a given media file,

file_url - enables using the file_url function in Twig,

translation - returns the translation of a given entity,

cache_metadata - adds cache metadata to the printed field,

php - executes the given string of characters as PHP code.

You can find a detailed description of the filters together with examples of use in the above-linked Twig Tweak cheat sheet.

Twig Tweak module - summary

The Twig Tweak module saves time and opens up new possibilities for developers. The filters and functions it provides are useful in everyday work with Twig. The module is very popular, well-supported, and willingly recommended by the community. As a team of Drupal developers, we recommend installing and trying out the possibilities provided by the Twig Tweak module.

Droptica: Enhanced Drupal templates. Review of the Twig Tweak Module

Main Drupal Feed - Thu, 06/02/2022 - 12:23

When using any kind of solution, we usually encounter the need to create generic support functions. A similar situation occurs when working with templates in Drupal 9. If you’ve ever created custom code to display a block, view, or entities in a Drupal 9 template, and are interested in ready-made and tested solution, this article is for you. We’ll show you the Twig Tweak module, which provides a number of support functions.

Twig and Drupal

Twig is a template engine for PHP, released in 2009. It’s constantly developed. As at the date of writing this article, the latest version is 3.4.1. Twig is an integral part of the Symfony framework, and thus – also of Drupal 9. Drupal in its own way implements certain concepts, such as entities, blocks, and views. To build the final HTML from the so-called render arrays, Drupal uses internal classes designed for this purpose. Twig, however, doesn't know by default how they work. Because of this, it’s natively impossible to, for example, render a block or view with any parameters and in any place just by using the Twig engine. To make such an operation possible, the Drupal community has created the Twig Tweak module, which introduces a substantial list of Twig extensions addressing the most common Drupal-specific problems.

Twig Tweak module

The module was released on 3 January 2016, and its latest update was on 15 April 2022. Twig Tweak has an older version that is compatible with Drupal 8 and 9, and a newer one that requires Drupal 9. For obvious reasons (using Symfony from version 8), the module doesn't have a Drupal 7 version.

The Twig Tweak module provides a collection of extensions for Twig that allow you to, for example, render views, blocks, regions, entities, fields, menus, forms, tokens, and more. The full list of possibilities is provided in the Twig Tweak cheat sheet prepared by the authors.

Twig Tweak is currently used by over 100 thousand websites. The latest 3.x version is gaining in popularity over the older 2.x version, which is experiencing slight but continuous drops.

 

Source: Drupal.org

The creator and the main person maintaining the module is the user Chi. Due to the popularity of the module, the full list of people who contributed to its development is too extensive to be quoted.

Installation

The Twig Tweak module's installation is standard.

composer require drupal/twig_tweak drush pm:enable twig_tweak

The module has no dependencies other than Drupal Core and also doesn't provide custom permissions.

There is one configuration option - twig_tweak_enable_php_filter - which is set in the settings.php file. It is set to TRUE / FALSE and is FALSE by default. Enabling this option adds the possibility of using pure PHP in Twig. The option is turned off by default, possibly for security reasons.

How to use Twig Tweak

After installing the module, we get access to the following functions:

drupal_view

Renders the provided view. Example: 

{{ drupal_view(‘view_id’, 'view_display_id’) }}

drupal_view_result

Renders only the result of the provided view. Example: 

{{ drupal_view_result(‘view_id’, 'view_display_id’) }}

drupal_block

Renders the provided block. Example:

{# Block with default configuration. #} {{ drupal_block('block_id') }} {# Block with custom configuration. #} {{ drupal_block('block_id', {config_id: 'foo', another_config_id: false}) }} {# Block without block.html.twig theming. #} {{ drupal_block('block_id', wrapper=false) }}

drupal_region

Renders the provided region. Example:

{# Foo region of the default theme. #} {{ drupal_region(‘foo’) }} {# Foo region of Bartik theme. #} {{ drupal_region('foo', 'bartik') }} Other functions in Twig Tweak

Let's take a look at other options available in this module:

drupal_entity - renders entities,

drupal_entity_form - renders entity form,

drupal_field - renders field,

drupal_menu - renders menu,

drupal_form - renders form,

drupal_image - renders image,

drupal_token - replaces token,

drupal_config - renders configurations,

drupal_dump / dd - renders a readable version of the variable's content (helpful for debugging),

drupal_title - renders the title of the current page,

drupal_url - renders URL,

drupal_link - renders link,

drupal_messages - renders status messages,

drupal_breadcrumb - renders breadcrumbs,

drupal_breakpoint - triggers the Xdebug's breakpoint,

drupal_contextual_links - renders contextual links.

Filters in the Twig Tweak module

Now we'll take a look at the filters available in the tool:

token_replace - replaces token,

preg_replace - enables using the preg_replace function in Twig,

image_style - applies the given image style,

transliterate - transliterates text from Unicode to US-ASCII,

check_markup - filters text based on the text style specified in the system,

format_size - formats the given number of bytes into a character representation with a multiple suffix,

truncate - limits the given text to the chosen number of characters,

view - returns the render array for the given entity or field,

with - works inversely to the core's without filter,

children - used in multiple-selection fields to get a list of items,

file_uri - returns the URI of a given media file,

file_url - enables using the file_url function in Twig,

translation - returns the translation of a given entity,

cache_metadata - adds cache metadata to the printed field,

php - executes the given string of characters as PHP code.

You can find a detailed description of the filters together with examples of use in the above-linked Twig Tweak cheat sheet.

Twig Tweak module - summary

The Twig Tweak module saves time and opens up new possibilities for developers. The filters and functions it provides are useful in everyday work with Twig. The module is very popular, well-supported, and willingly recommended by the community. As a team of Drupal developers, we recommend installing and trying out the possibilities provided by the Twig Tweak module.

Droptica: Enhanced Drupal templates. Review of the Twig Tweak Module

Main Drupal Feed - Thu, 06/02/2022 - 12:23

When using any kind of solution, we usually encounter the need to create generic support functions. A similar situation occurs when working with templates in Drupal 9. If you’ve ever created custom code to display a block, view, or entities in a Drupal 9 template, and are interested in ready-made and tested solution, this article is for you. We’ll show you the Twig Tweak module, which provides a number of support functions.

Twig and Drupal

Twig is a template engine for PHP, released in 2009. It’s constantly developed. As at the date of writing this article, the latest version is 3.4.1. Twig is an integral part of the Symfony framework, and thus – also of Drupal 9. Drupal in its own way implements certain concepts, such as entities, blocks, and views. To build the final HTML from the so-called render arrays, Drupal uses internal classes designed for this purpose. Twig, however, doesn't know by default how they work. Because of this, it’s natively impossible to, for example, render a block or view with any parameters and in any place just by using the Twig engine. To make such an operation possible, the Drupal community has created the Twig Tweak module, which introduces a substantial list of Twig extensions addressing the most common Drupal-specific problems.

Twig Tweak module

The module was released on 3 January 2016, and its latest update was on 15 April 2022. Twig Tweak has an older version that is compatible with Drupal 8 and 9, and a newer one that requires Drupal 9. For obvious reasons (using Symfony from version 8), the module doesn't have a Drupal 7 version.

The Twig Tweak module provides a collection of extensions for Twig that allow you to, for example, render views, blocks, regions, entities, fields, menus, forms, tokens, and more. The full list of possibilities is provided in the Twig Tweak cheat sheet prepared by the authors.

Twig Tweak is currently used by over 100 thousand websites. The latest 3.x version is gaining in popularity over the older 2.x version, which is experiencing slight but continuous drops.

 

Source: Drupal.org

The creator and the main person maintaining the module is the user Chi. Due to the popularity of the module, the full list of people who contributed to its development is too extensive to be quoted.

Installation

The Twig Tweak module's installation is standard.

composer require drupal/twig_tweak drush pm:enable twig_tweak

The module has no dependencies other than Drupal Core and also doesn't provide custom permissions.

There is one configuration option - twig_tweak_enable_php_filter - which is set in the settings.php file. It is set to TRUE / FALSE and is FALSE by default. Enabling this option adds the possibility of using pure PHP in Twig. The option is turned off by default, possibly for security reasons.

How to use Twig Tweak

After installing the module, we get access to the following functions:

drupal_view

Renders the provided view. Example: 

{{ drupal_view(‘view_id’, 'view_display_id’) }}

drupal_view_result

Renders only the result of the provided view. Example: 

{{ drupal_view_result(‘view_id’, 'view_display_id’) }}

drupal_block

Renders the provided block. Example:

{# Block with default configuration. #} {{ drupal_block('block_id') }} {# Block with custom configuration. #} {{ drupal_block('block_id', {config_id: 'foo', another_config_id: false}) }} {# Block without block.html.twig theming. #} {{ drupal_block('block_id', wrapper=false) }}

drupal_region

Renders the provided region. Example:

{# Foo region of the default theme. #} {{ drupal_region(‘foo’) }} {# Foo region of Bartik theme. #} {{ drupal_region('foo', 'bartik') }} Other functions in Twig Tweak

Let's take a look at other options available in this module:

drupal_entity - renders entities,

drupal_entity_form - renders entity form,

drupal_field - renders field,

drupal_menu - renders menu,

drupal_form - renders form,

drupal_image - renders image,

drupal_token - replaces token,

drupal_config - renders configurations,

drupal_dump / dd - renders a readable version of the variable's content (helpful for debugging),

drupal_title - renders the title of the current page,

drupal_url - renders URL,

drupal_link - renders link,

drupal_messages - renders status messages,

drupal_breadcrumb - renders breadcrumbs,

drupal_breakpoint - triggers the Xdebug's breakpoint,

drupal_contextual_links - renders contextual links.

Filters in the Twig Tweak module

Now we'll take a look at the filters available in the tool:

token_replace - replaces token,

preg_replace - enables using the preg_replace function in Twig,

image_style - applies the given image style,

transliterate - transliterates text from Unicode to US-ASCII,

check_markup - filters text based on the text style specified in the system,

format_size - formats the given number of bytes into a character representation with a multiple suffix,

truncate - limits the given text to the chosen number of characters,

view - returns the render array for the given entity or field,

with - works inversely to the core's without filter,

children - used in multiple-selection fields to get a list of items,

file_uri - returns the URI of a given media file,

file_url - enables using the file_url function in Twig,

translation - returns the translation of a given entity,

cache_metadata - adds cache metadata to the printed field,

php - executes the given string of characters as PHP code.

You can find a detailed description of the filters together with examples of use in the above-linked Twig Tweak cheat sheet.

Twig Tweak module - summary

The Twig Tweak module saves time and opens up new possibilities for developers. The filters and functions it provides are useful in everyday work with Twig. The module is very popular, well-supported, and willingly recommended by the community. As a team of Drupal developers, we recommend installing and trying out the possibilities provided by the Twig Tweak module.

Do The Woo Community: Advanced Security for WooCommerce Builders wit Rob Cairns & Robert Rowley

Wordpress Planet - Thu, 06/02/2022 - 09:35

WordPress security veterans Rob Cairns and Robert Rowley have a great conversation on building sites for WooCommerce while keeping them secure.

>> The post Advanced Security for WooCommerce Builders wit Rob Cairns & Robert Rowley appeared first on Do the Woo - a WooCommerce Builder Community .

Samuel Mortenson: Meet Bookish, an install profile for static Drupal blogs

Main Drupal Feed - Thu, 06/02/2022 - 08:00
For the last four years I’ve been working on a static site generator for Drupal called Tome. Unlike other generators Tome uses “vanilla” Drupal, which means that if you know how to build a Drupal site, you know how to build a Tome site! One downside of this is that when comparing a default install of Drupal with a default install of something like Gatsby, Drupal looks pretty outdated. I wanted to show Tome off but couldn’t do it well with core, so I decided to focus my energy on a new install profile for static blogs - Bookish.

Samuel Mortenson: Meet Bookish, an install profile for static Drupal blogs

Main Drupal Feed - Thu, 06/02/2022 - 08:00
For the last four years I’ve been working on a static site generator for Drupal called Tome. Unlike other generators Tome uses “vanilla” Drupal, which means that if you know how to build a Drupal site, you know how to build a Tome site! One downside of this is that when comparing a default install of Drupal with a default install of something like Gatsby, Drupal looks pretty outdated. I wanted to show Tome off but couldn’t do it well with core, so I decided to focus my energy on a new install profile for static blogs - Bookish.

Samuel Mortenson: Meet Bookish, an install profile for static Drupal blogs

Main Drupal Feed - Thu, 06/02/2022 - 08:00
For the last four years I’ve been working on a static site generator for Drupal called Tome. Unlike other generators Tome uses “vanilla” Drupal, which means that if you know how to build a Drupal site, you know how to build a Tome site! One downside of this is that when comparing a default install of Drupal with a default install of something like Gatsby, Drupal looks pretty outdated. I wanted to show Tome off but couldn’t do it well with core, so I decided to focus my energy on a new install profile for static blogs - Bookish.

PreviousNext: The right way to check for empty content in Twig

Main Drupal Feed - Thu, 06/02/2022 - 05:39

Have you ever used {% if content|render|trim is not empty %} in twig to validate content is not empty?

If so, you might end up with some surprises related to the use of the render method.
 

by mohit.aghera / 2 June 2022 Introduction

Checking that content is not empty before rendering is good practice. Typically we call the “trim” method as well so all the space gets trimmed and we get an accurate indication if the content is empty.

Usually, developers uses snippet like {% if content|render|trim is not empty %} to ensure that content is not empty.

Recently while working on one of our projects, the client informed us that Webform was having issues with Recaptcha and was throwing errors related to invalid tokens. To debug further, we disabled recaptcha handler and saw that Webform submissions were being recorded twice.

While debugging further, we noticed that all the things were working as expected for Webform and simple_recaptcha module’s Webform handler. So both of those causes were out of the picture.

We'd experienced a similar issue before, and in that case the cause was a [node:description] tag from Metatags that was rendering the embedded Webform. At first we thought this might have been the case, but debugging revealed that Metatags was not in the mix this time.

During debugging further around rendering process, we noticed that render() was being called twice. Rendering twice was causing issues with recaptcha tokens. Because the second render was invalidating the original recaptcha token.

Upon debugging further we found the following twig templates code was causing issues. 
 

​​{% if content|render|trim is not empty %} 
 
  
 {{ content.content }} 
  
 
{% endif %} 
 

Here, if you notice the block {% if content|render|trim is not empty %} that we are calling render method of TwigExtension.php. So this was rendering the content the first time and then the second time we are actually rendering the content using {{ content.content }}. So this second render was invalidating the previous token generated by the Webform handler.

Solution

As the use of the render function was causing issues we need to use a different approach to validate the issue.

In such situations twig’s set tag comes to the rescue.

We can use it in conjunction with the spaceless twig filter to only render the content once. The spaceless filter makes sure we don't get a false positive from whitespace, just like the trim function did before.

So we can refactor above twig snippet using the set tag and the spaceless filter like this:

{% set content_render %}{% apply spaceless %}
 {{ content.content }}
{% endapply %}{% endset %}
{% if content_render is not empty %}
 
   
     {{ content_render }}
   
 
{% endif %}

By using this approach, we can achieve the same thing as the original approach, but with only one render.

Conclusion

The set tag in conjunction with the spaceless filter allows us to safely render a variable, remove any whitespace between HTML tags and then use that as a variable to evaluate if the output is empty. If not, we can just output the already-rendered variable and in doing so avoid additional render in our twig templates. 
 

Tagged Drupal Development, Theming, Drupal Theming, Twig

PreviousNext: The right way to check for empty content in Twig

Main Drupal Feed - Thu, 06/02/2022 - 05:39

Have you ever used {% if content|render|trim is not empty %} in twig to validate content is not empty?

If so, you might end up with some surprises related to the use of the render method.
 

by mohit.aghera / 2 June 2022 Introduction

Checking that content is not empty before rendering is good practice. Typically we call the “trim” method as well so all the space gets trimmed and we get an accurate indication if the content is empty.

Usually, developers uses snippet like {% if content|render|trim is not empty %} to ensure that content is not empty.

Recently while working on one of our projects, the client informed us that Webform was having issues with Recaptcha and was throwing errors related to invalid tokens. To debug further, we disabled recaptcha handler and saw that Webform submissions were being recorded twice.

While debugging further, we noticed that all the things were working as expected for Webform and simple_recaptcha module’s Webform handler. So both of those causes were out of the picture.

We'd experienced a similar issue before, and in that case the cause was a [node:description] tag from Metatags that was rendering the embedded Webform. At first we thought this might have been the case, but debugging revealed that Metatags was not in the mix this time.

During debugging further around rendering process, we noticed that render() was being called twice. Rendering twice was causing issues with recaptcha tokens. Because the second render was invalidating the original recaptcha token.

Upon debugging further we found the following twig templates code was causing issues. 
 

​​{% if content|render|trim is not empty %} 
 
  
 {{ content.content }} 
  
 
{% endif %} 
 

Here, if you notice the block {% if content|render|trim is not empty %} that we are calling render method of TwigExtension.php. So this was rendering the content the first time and then the second time we are actually rendering the content using {{ content.content }}. So this second render was invalidating the previous token generated by the Webform handler.

Solution

As the use of the render function was causing issues we need to use a different approach to validate the issue.

In such situations twig’s set tag comes to the rescue.

We can use it in conjunction with the spaceless twig filter to only render the content once. The spaceless filter makes sure we don't get a false positive from whitespace, just like the trim function did before.

So we can refactor above twig snippet using the set tag and the spaceless filter like this:

{% set content_render %}{% apply spaceless %}
 {{ content.content }}
{% endapply %}{% endset %}
{% if content_render is not empty %}
 
   
     {{ content_render }}
   
 
{% endif %}

By using this approach, we can achieve the same thing as the original approach, but with only one render.

Conclusion

The set tag in conjunction with the spaceless filter allows us to safely render a variable, remove any whitespace between HTML tags and then use that as a variable to evaluate if the output is empty. If not, we can just output the already-rendered variable and in doing so avoid additional render in our twig templates. 
 

Tagged Drupal Development, Theming, Drupal Theming, Twig

Liip: Liip revolutioniert das Lohnsystem

Main Drupal Feed - Wed, 06/01/2022 - 22:00

Das neue Lohnsystem der selbstorganisierten Digitalagentur Liip gewinnt den Swiss HR Award in der Kategorie “Diversity, Inclusion, Equality”. Der Liip Deal stellt Mitarbeitende ins Zentrum. Ganz nach dem Motto digital, human progress wird die agile Weiterentwicklung zugänglich gemacht, denn viele fortschrittliche Organisationen stehen vor dem Schritt, neue Lohnsysteme einzuführen.

Der Swiss HR Award

Der Swiss HR Award zeichnet jährlich innovative Projekte in der “People-Welt” aus. Die Inhalte der Arbeiten müssen kreativ neue Wege beschreiten, mutig Neues ausprobieren und Wirkung zeigen - mit effektiven Resultaten. Der Swiss HR Award setzt damit Qualitätsstandards für Arbeitsmodelle und zukunftsweisende Ideen im HR Bereich. Die Fachjury beurteilt Projekte in sieben Kategorien. Mit dem neuen Lohnsystem wandelt Liip die Kultur und setzt sich aktiv für ein System ein, welches Diversität, Inklusion und Gleichstellung fördert.

Von link nach rechts: Zahida Huber, Sergio Mendolia, Nadja Perroulaz und Pascal Helfenstein

“Selbstbestimmung, Gleichstellung und Klarheit in der Entschädigung war unser Ziel. Das war nicht immer einfach zu balancieren. Aber wir haben es geschafft, ein System zu kreieren, dass zur Selbstorganisation passt und die Mitarbeitenden ins Zentrum stellt”. So Sergio Mendolia, Fullstack Developer and Salary Process Developer bei Liip.

Das neue Lohnsystem - der Liip Deal

Ein gleichberechtigtes Lohnsystem, das keine Unterschiede zwischen Berufsbildern und möglichst kleine Lohnunterschiede macht, das lebt Liip schon seit der Gründung. Um am Ball zu bleiben, entwickelt das Digitalunternehmen sein Entlöhnungssystem kontinuierlich weiter. Das Lohnsystem wurde 2016 entwickelt und basiert auf dem Konzept der Peer-Evaluation. Seit 2018 sind das System sowie die daraus resultierenden Löhne vollständig transparent: Alle Mitarbeitende wissen, wer was verdient und wie der Lohn berechnet wird; das bleibt auch so. Das neue System basiert auf 2 Kriterien mit jeweils 6 Stufen, Ein Basissalär basierend auf den Lohnrechner bildet die Grundlage. Mitarbeitende schätzen darin selbst ihre Expertise und den erzielten Impact ein, welcher dann von mindestens 2 Kolleg*innen überprüft und kommentiert wird. Das Alter und die Loyalität dazugerechnet, entsteht der individuelle Lohn.

Jurypräsident Jörg Buckmann übergibt den Swiss HR Award an Sergio Mendolia und Pascal Helfenstein

“Agiles Arbeiten gehört auch bei internen Veränderungen zum Standard. Wir teilen unsere Erfahrungen bewusst mit agilen Organisationen und anderen interessierten Unternehmen, denn Open Source ist in unserer DNA. Es macht Spass, mit solchen Projekten aktiv etwas zu bewegen.” sagt Pascal Helfenstein, Software Engineer und Salary Process Developer bei Liip.

Mitarbeitende im Zentrum des neuen Lohnsystems

Was ist revolutionär am neuen Lohnsystem von Liip? Es ist auf agile Organisationen zugeschnitten, impliziert eine hohe Eigenverantwortung und ist Zweck- und Wirkungsorientiert. Ein Lohnsystem also, das nicht verhandelbar ist, auf Selbst- und Peer-Evaluationen basiert und transparent ist. Alle Mitarbeitenden - auch die ehemalige Geschäftsleitung - werden in das System eingebunden. Es gilt die gleiche Bezahlung in allen Funktionen durch das Basissalär. Zusätzlich dazu werden höhere Gehaltsstufen mit der Expertise und Wirkung erreicht. Zudem macht Liip als Arbeitgeberin explizit, dass Mitarbeitende nicht nur mit ihrem monatlichen Gehalt entlöhnt werden, sondern mit einem ganzen Paket, dem “Liip Deal”.

“Mit unserem “Liip Deal” haben wir ein in der Schweiz neues und einzigartiges System entwickelt. Alle Prozesse und Systeme wurden von Grund auf neu definiert und entwickelt. Mit dem Lohnrechner als Basis bleiben die Löhne marktgerecht. Und wir nehmen die Mitarbeitenden in die Verantwortung, denn sie starten eine Lohnveränderung mit der Selbstevaluation”, sagt Nadja Perroulaz, Mitgründerin von Liip.

Die Digitalagentur freut sich sehr über die Auszeichnung am diesjährigen Swiss HR Award.
Mehr zum Thema: liip.ch/de/blog/salary-system-liip
Der Podcast des Agile Breakfast: swissict.ch/agile-breakfast-kompakt-002-mit-nadja-perroulaz

Liip: Liip revolutioniert das Lohnsystem

Main Drupal Feed - Wed, 06/01/2022 - 22:00

Das neue Lohnsystem der selbstorganisierten Digitalagentur Liip gewinnt den Swiss HR Award in der Kategorie “Diversity, Inclusion, Equality”. Der Liip Deal stellt Mitarbeitende ins Zentrum. Ganz nach dem Motto digital, human progress wird die agile Weiterentwicklung zugänglich gemacht, denn viele fortschrittliche Organisationen stehen vor dem Schritt, neue Lohnsysteme einzuführen.

Der Swiss HR Award

Der Swiss HR Award zeichnet jährlich innovative Projekte in der “People-Welt” aus. Die Inhalte der Arbeiten müssen kreativ neue Wege beschreiten, mutig Neues ausprobieren und Wirkung zeigen - mit effektiven Resultaten. Der Swiss HR Award setzt damit Qualitätsstandards für Arbeitsmodelle und zukunftsweisende Ideen im HR Bereich. Die Fachjury beurteilt Projekte in sieben Kategorien. Mit dem neuen Lohnsystem wandelt Liip die Kultur und setzt sich aktiv für ein System ein, welches Diversität, Inklusion und Gleichstellung fördert.

Von link nach rechts: Zahida Huber, Sergio Mendolia, Nadja Perroulaz und Pascal Helfenstein

“Selbstbestimmung, Gleichstellung und Klarheit in der Entschädigung war unser Ziel. Das war nicht immer einfach zu balancieren. Aber wir haben es geschafft, ein System zu kreieren, dass zur Selbstorganisation passt und die Mitarbeitenden ins Zentrum stellt”. So Sergio Mendolia, Fullstack Developer and Salary Process Developer bei Liip.

Das neue Lohnsystem - der Liip Deal

Ein gleichberechtigtes Lohnsystem, das keine Unterschiede zwischen Berufsbildern und möglichst kleine Lohnunterschiede macht, das lebt Liip schon seit der Gründung. Um am Ball zu bleiben, entwickelt das Digitalunternehmen sein Entlöhnungssystem kontinuierlich weiter. Das Lohnsystem wurde 2016 entwickelt und basiert auf dem Konzept der Peer-Evaluation. Seit 2018 sind das System sowie die daraus resultierenden Löhne vollständig transparent: Alle Mitarbeitende wissen, wer was verdient und wie der Lohn berechnet wird; das bleibt auch so. Das neue System basiert auf 2 Kriterien mit jeweils 6 Stufen, Ein Basissalär basierend auf den Lohnrechner bildet die Grundlage. Mitarbeitende schätzen darin selbst ihre Expertise und den erzielten Impact ein, welcher dann von mindestens 2 Kolleg*innen überprüft und kommentiert wird. Das Alter und die Loyalität dazugerechnet, entsteht der individuelle Lohn.

Jurypräsident Jörg Buckmann übergibt den Swiss HR Award an Sergio Mendolia und Pascal Helfenstein

“Agiles Arbeiten gehört auch bei internen Veränderungen zum Standard. Wir teilen unsere Erfahrungen bewusst mit agilen Organisationen und anderen interessierten Unternehmen, denn Open Source ist in unserer DNA. Es macht Spass, mit solchen Projekten aktiv etwas zu bewegen.” sagt Pascal Helfenstein, Software Engineer und Salary Process Developer bei Liip.

Mitarbeitende im Zentrum des neuen Lohnsystems

Was ist revolutionär am neuen Lohnsystem von Liip? Es ist auf agile Organisationen zugeschnitten, impliziert eine hohe Eigenverantwortung und ist Zweck- und Wirkungsorientiert. Ein Lohnsystem also, das nicht verhandelbar ist, auf Selbst- und Peer-Evaluationen basiert und transparent ist. Alle Mitarbeitenden - auch die ehemalige Geschäftsleitung - werden in das System eingebunden. Es gilt die gleiche Bezahlung in allen Funktionen durch das Basissalär. Zusätzlich dazu werden höhere Gehaltsstufen mit der Expertise und Wirkung erreicht. Zudem macht Liip als Arbeitgeberin explizit, dass Mitarbeitende nicht nur mit ihrem monatlichen Gehalt entlöhnt werden, sondern mit einem ganzen Paket, dem “Liip Deal”.

“Mit unserem “Liip Deal” haben wir ein in der Schweiz neues und einzigartiges System entwickelt. Alle Prozesse und Systeme wurden von Grund auf neu definiert und entwickelt. Mit dem Lohnrechner als Basis bleiben die Löhne marktgerecht. Und wir nehmen die Mitarbeitenden in die Verantwortung, denn sie starten eine Lohnveränderung mit der Selbstevaluation”, sagt Nadja Perroulaz, Mitgründerin von Liip.

Die Digitalagentur freut sich sehr über die Auszeichnung am diesjährigen Swiss HR Award.
Mehr zum Thema: liip.ch/de/blog/salary-system-liip
Der Podcast des Agile Breakfast: swissict.ch/agile-breakfast-kompakt-002-mit-nadja-perroulaz

Liip: Liip revolutioniert das Lohnsystem

Main Drupal Feed - Wed, 06/01/2022 - 22:00

Das neue Lohnsystem der selbstorganisierten Digitalagentur Liip gewinnt den Swiss HR Award in der Kategorie “Diversity, Inclusion, Equality”. Der Liip Deal stellt Mitarbeitende ins Zentrum. Ganz nach dem Motto digital, human progress wird die agile Weiterentwicklung zugänglich gemacht, denn viele fortschrittliche Organisationen stehen vor dem Schritt, neue Lohnsysteme einzuführen.

Der Swiss HR Award

Der Swiss HR Award zeichnet jährlich innovative Projekte in der “People-Welt” aus. Die Inhalte der Arbeiten müssen kreativ neue Wege beschreiten, mutig Neues ausprobieren und Wirkung zeigen - mit effektiven Resultaten. Der Swiss HR Award setzt damit Qualitätsstandards für Arbeitsmodelle und zukunftsweisende Ideen im HR Bereich. Die Fachjury beurteilt Projekte in sieben Kategorien. Mit dem neuen Lohnsystem wandelt Liip die Kultur und setzt sich aktiv für ein System ein, welches Diversität, Inklusion und Gleichstellung fördert.

Von link nach rechts: Zahida Huber, Sergio Mendolia, Nadja Perroulaz und Pascal Helfenstein

“Selbstbestimmung, Gleichstellung und Klarheit in der Entschädigung war unser Ziel. Das war nicht immer einfach zu balancieren. Aber wir haben es geschafft, ein System zu kreieren, dass zur Selbstorganisation passt und die Mitarbeitenden ins Zentrum stellt”. So Sergio Mendolia, Fullstack Developer and Salary Process Developer bei Liip.

Das neue Lohnsystem - der Liip Deal

Ein gleichberechtigtes Lohnsystem, das keine Unterschiede zwischen Berufsbildern und möglichst kleine Lohnunterschiede macht, das lebt Liip schon seit der Gründung. Um am Ball zu bleiben, entwickelt das Digitalunternehmen sein Entlöhnungssystem kontinuierlich weiter. Das Lohnsystem wurde 2016 entwickelt und basiert auf dem Konzept der Peer-Evaluation. Seit 2018 sind das System sowie die daraus resultierenden Löhne vollständig transparent: Alle Mitarbeitende wissen, wer was verdient und wie der Lohn berechnet wird; das bleibt auch so. Das neue System basiert auf 2 Kriterien mit jeweils 6 Stufen, Ein Basissalär basierend auf den Lohnrechner bildet die Grundlage. Mitarbeitende schätzen darin selbst ihre Expertise und den erzielten Impact ein, welcher dann von mindestens 2 Kolleg*innen überprüft und kommentiert wird. Das Alter und die Loyalität dazugerechnet, entsteht der individuelle Lohn.

Jurypräsident Jörg Buckmann übergibt den Swiss HR Award an Sergio Mendolia und Pascal Helfenstein

“Agiles Arbeiten gehört auch bei internen Veränderungen zum Standard. Wir teilen unsere Erfahrungen bewusst mit agilen Organisationen und anderen interessierten Unternehmen, denn Open Source ist in unserer DNA. Es macht Spass, mit solchen Projekten aktiv etwas zu bewegen.” sagt Pascal Helfenstein, Software Engineer und Salary Process Developer bei Liip.

Mitarbeitende im Zentrum des neuen Lohnsystems

Was ist revolutionär am neuen Lohnsystem von Liip? Es ist auf agile Organisationen zugeschnitten, impliziert eine hohe Eigenverantwortung und ist Zweck- und Wirkungsorientiert. Ein Lohnsystem also, das nicht verhandelbar ist, auf Selbst- und Peer-Evaluationen basiert und transparent ist. Alle Mitarbeitenden - auch die ehemalige Geschäftsleitung - werden in das System eingebunden. Es gilt die gleiche Bezahlung in allen Funktionen durch das Basissalär. Zusätzlich dazu werden höhere Gehaltsstufen mit der Expertise und Wirkung erreicht. Zudem macht Liip als Arbeitgeberin explizit, dass Mitarbeitende nicht nur mit ihrem monatlichen Gehalt entlöhnt werden, sondern mit einem ganzen Paket, dem “Liip Deal”.

“Mit unserem “Liip Deal” haben wir ein in der Schweiz neues und einzigartiges System entwickelt. Alle Prozesse und Systeme wurden von Grund auf neu definiert und entwickelt. Mit dem Lohnrechner als Basis bleiben die Löhne marktgerecht. Und wir nehmen die Mitarbeitenden in die Verantwortung, denn sie starten eine Lohnveränderung mit der Selbstevaluation”, sagt Nadja Perroulaz, Mitgründerin von Liip.

Die Digitalagentur freut sich sehr über die Auszeichnung am diesjährigen Swiss HR Award.
Mehr zum Thema: liip.ch/de/blog/salary-system-liip
Der Podcast des Agile Breakfast: swissict.ch/agile-breakfast-kompakt-002-mit-nadja-perroulaz

Pages