Drupal

Lullabot: Rocket Ship Fast Jobs in CircleCI by Preinstalling the Database

Planet Drupal - 17 April 2019 - 11:00am

CircleCI is great at enabling developers defining a set of images to spin up an environment for testing. When dealing with a website with a database, the usual build process involves downloading a database dump, installing it, and then performing tests. Here is a sample job that follows this approach. Notice where the majority of the time is allocated:

Categories: Drupal

WeKnow: Drupalcon Seattle 2019 Recap

Planet Drupal - 17 April 2019 - 10:42am
Drupalcon Seattle 2019 Recap

DrupalCon Seattle 2019 was my second Drupal Conference. Everybody enjoys travel, and everybody should enjoy learning while at it! This year I had the opportunity to do both, taking benefit of the Professional Development Program that weKnow offers as well as taking my family on vacation.

The Washington State Convention Center

 

In my first hours in Seattle, I joined my teammates, got my credentials and the full information about the event... I was surprised by the variety of sessions available! One difference compared to Nashville 2018, this year there were only 2 days for room conferences, but the quantity looks similar. In fact, I did attend more sessions this year than in 2018.

dsabolo Wed, 04/17/2019 - 17:42
Categories: Drupal

Aten Design Group: Placing Components with Drupal's Extra Fields

Planet Drupal - 17 April 2019 - 10:17am

One of the challenges front-end developers face is adding new components to entity templates that exist outside of what is defined in the Field API; or in other words, adding dynamic components that aren’t really fields. Often this can be easily done by throwing the custom markup in a .html.twig file and calling it a day. But if you’re working on something that needs to be reusable, or if you’re collaborating with a site builder who doesn’t write code, the custom template route can be limiting.

Enter hook_entity_extra_field_info().

Content Moderation: A “Pseudo-Field” in Core

Drupal’s documentation says this hook “exposes ‘pseudo-field’ components on content entities.” You can see this hook in action with the Content Moderation module in core. All moderation-enabled entities can have an option box, placed via that entity’s Manage Display page, that contains a widget to update an entity’s moderation state in place rather than clicking through to the edit page.

The moderation option isn’t a real field. Rather, it’s what Drupal calls a “Pseudo Field.” But by using hook_entity_extra_field_info(), you wouldn’t know the difference. The moderation option can be moved around and configured for various display modes, just like “real” fields.

Using hook_entity_extra_field_info in a Custom Module

On a recent project, we needed to integrate a newer commenting service called Coral Talk. After searching, we learned that no module existed to integrate this service in Drupal. This presented a perfect use case for an Extra Field, and only needed two hooks for the bulk of the work:

/** * Implements hook_entity_extra_field_info(). */ function coral_talk_entity_extra_field_info() { // Load commenting configuration. $config = \Drupal::config(coral_talk.settings'); $extra = [];   // Loop over the content types configured to have comments // and get their bundle name. foreach ($config->get('content_types') as $bundle) { if ($bundle) { // Add info for Extra Field to nodes only, specific to configured // content types. This determines what shows on Manage Display. $extra['node'][$bundle]['display'][‘coral_talk_comments'] = [ 'label' => t(‘Coral Talk Comments'), 'description' => t('Place commenting on the page.'), 'weight' => 100, 'visible' => TRUE, ]; } }   // Return our new extra field. return $extra; }

After a cache clear, this new field will appear on the configured content types’ Manage Display page and can be placed on the content type along with the other fields for that content type. Now that the field is defined, it needs some info for what should be rendered to the page. This is handled by Drupal’s hook_ENTITY_TYPE_view() hook.

/** * Implements hook_ENTITY_TYPE_view(). */ function coral_talk_node_view( array &$build, \Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display, $view_mode ) { // 1. Check to see if our new field should be rendered on the entity display. // 2. Determine whether the user has permission to add comments. $condition = ( $display->getComponent(‘coral_talk_comments') && \Drupal::currentUser()->hasPermission('create coral comment') );   if ($condition) { $config = \Drupal::config(coral_talk.settings');   // Add the new field to the $build array with a call to a custom theme // hook to render the comments. Pass necessary config into comment // settings. $build[‘coral_talk_comments'] = [ '#theme' => 'coral_talk_comments', '#domain' => $config->get('domain') ?? '', ]; } }

After another cache clear, we’ll now see our comments being rendered to our content types in whichever view mode they’re enabled on. The moves setup of comments outside of code and into a place that’s more accessible and flexible for various users.

This approach is great for simple scenarios. One drawback, however, is that it’s not possible to define any custom configuration options for these pseudo fields. Each extra field is identical, and any configuration has to be hard coded in these hooks. This presents challenges for site builders, who might want to configure comments differently per content type however. Fortunately, there is a solution in contrib that changes how Extra Fields are defined and allows for developers to add configuration to each field. In the next post, we’ll explore the Extra Field Settings Provider module.

Categories: Drupal

Phase2: Migration: Making It All Work

Planet Drupal - 17 April 2019 - 10:04am

We’ve written a lot about content migration on our blog here—it’s something we have more than a passing interest in, because we do it a lot! The posts below cover the project management, estimation, and basics of content migration from Drupal to Drupal, and other sources too.

Categories: Drupal

Hook 42: Speaker Notes: Attending DrupalCon as a Presenter

Planet Drupal - 17 April 2019 - 6:42am

DrupalCon 2019 was a bit different for me. I have attended previous DrupalCons, usually sitting in the back of the room just taking in all that I could from experts around the world. This year, however, I had the opportunity to be a speaker. Not only was I afforded the opportunity to speak, but I had two separate sessions accepted.

Categories: Drupal

Migrate Expansion

New Drupal Modules - 17 April 2019 - 6:30am

Migration utilities to streamline D7 to D8 migrations.

This module aims to offer out of the box support for configuration migrations from Drupal 7 to Drupal 8, to expand the features from existing contrib modules that would normally require custom development work.

Categories: Drupal

Webform Timeout

New Drupal Modules - 17 April 2019 - 3:31am

Provides functionality for Webform (8.x) to limit user time during which he is able to make webform submission.

Good example for this functionality is a Quiz based on Webform with Webform Score module enabled.

Categories: Drupal

Doc to html

New Drupal Modules - 17 April 2019 - 1:11am
Categories: Drupal

Agiledrop.com Blog: Interview with Ruben Teijeiro, Drupal hero at 1xINTERNET and co-founder of Youpal

Planet Drupal - 17 April 2019 - 12:40am

For our latest Drupal Community interview, we had a really great talk with Ruben Teijeiro of Youpal and 1xINTERNET. Ruben revealed to us the meaning and responsibilities of a Drupal hero, a role which has enabled him to spread Drupal awareness all over the world and meet diverse Drupal communities.

READ MORE
Categories: Drupal

OPTASY: What Makes the End-User Experience in Drupal 8 Stand Out?

Planet Drupal - 17 April 2019 - 12:30am
What Makes the End-User Experience in Drupal 8 Stand Out? adriana.cacoveanu Wed, 04/17/2019 - 07:30

What makes Drupal a great choice from a UX standpoint? What features are responsible for the enhanced end-user experience in Drupal 8? Those features that enable you to easily create an intuitive and enjoyable visitor experience on your own Drupal-based website/application.

And to constantly improve it...

Is it all those performance enhancements that it ships with? Or maybe its “responsive out-of-the-box” nature? Or rather its multilingual capabilities?
 

1. But First: 7 Evergreen Ways to Improve Your Website's UX

It goes without saying that, in order to create an enjoyable, rich user experience on your Drupal 8 website, you'll need to:
 

Categories: Drupal

Search Alter

New Drupal Modules - 17 April 2019 - 12:08am

Search Alter module allows users to expend or modify core features of search module. In this module, you can easily modify No result Behavior.

Paths
  • Configuration page :/admin/config/system/search_alter

Categories: Drupal

EZProxy Groups for Roles

New Drupal Modules - 16 April 2019 - 3:07pm

The EZProxy module provides Drupal Users access to databases that may have restricted access. The EZProxy system can restrict access to Groups that are managed by the EZProxy provider. This module allows these Groups to be mapped to Drupal User Roles so that when a Drupal User tries to authenticate to EZProxy the Groups can be sent based on the Roles the User has assigned to them.

Categories: Drupal

Amazee Labs: DrupalCon Seattle Recap - A week to remember

Planet Drupal - 16 April 2019 - 11:04am
DrupalCon Seattle Recap - A week to remember

I was so excited about going to DrupalCon Seattle, I started packing one week in advance. Granted, I decided to travel light, so my carry-on suitcase quickly showed the task wouldn’t take long.

Maria Comas Tue, 04/16/2019 - 20:04

Every DrupalCon I have been lucky enough to attend has been special in their own way. This was my first time going back to the States after moving out almost two years ago, so after an airport hiccup (protip: make sure to apply for a new ESTA if you happen to renew your passport after you felt very accomplished getting it ready so much time in advance) I was happy to set my regular-sized foot onto its northwest corner.  

The week started very nicely, with some time to explore the city and enjoy a selection of its fine food. As there weren’t any sessions on until Wednesday, Tuesday was mostly hanging out with teammates and other friendly faces in the contribution room.

 Anyone else noticed how in the US bathroom stall’s doors never quite make it to the edge?

After a delicious and fun dinner where all Amazees gathered, it was party time. One of the highlights of the week was getting to attend the Museum of Pop Culture at Pantheon’s party, which featured some awesome exhibits. My favourite part was a sound lab where one could learn how to play real instruments (Louie Louie anyone?).

“Next DrupalCon we need a setlist."

Wednesday and Thursday were packed with brain-revving sessions. Gatsby, data-fetching strategies, and front-end performance were a few of the topics that got a lot of circulation on the printed schedule. But it was diversity and inclusion that rightfully took the main stage at the keynotes. Dries Buytaert began his speech acknowledging that Open Source is not a meritocracy, and Marcy Sutton and Nythia Ruff closed with essential insights on how to use our collective power to build inclusive communities and products.

All in all, there were many moments that made this past week remarkable. Many involved spending time with the team, others meeting new people. Some were expected, like the Women in Drupal luncheon. Others were not, like the Movement BoF that got me walking as if I was auditioning for the Ministry of Silly Walks.

One remarkable moment was definitely getting to give my (first ever) presentation at a DrupalCon (I can confirm, the Speakers-only room has special catering!). All of these moments made me once more very grateful for being able to be a part of this. I’m looking forward next time I get to play suitcase Tetris and find out what will make the next DrupalCon a one-of-a-kind experience.

Categories: Drupal

Help Topics Backlinks

New Drupal Modules - 16 April 2019 - 11:01am

This experimental module adds backlinks to the shiny new experimental help topics module.

Use case: Consider you write a help topic for a feature module, explaining how the hell your sitebuilding tricks work together. You crosslink to field configuration, views, rules, and more. Then you will see "Relevant Help Topics" backlinks on top of each linked page.

Categories: Drupal

Entity Tags

New Drupal Modules - 16 April 2019 - 10:21am
INTRODUCTION

This module adds a service decorator to Entity Type Manager to provide the ability to tag entity types. This module is an api tool.

REQUIREMENTS

No special requirements.

INSTALLATION

Install as you would normally install a contributed Drupal module. Visit: https://www.drupal.org/docs/8/extending-drupal-8/installing-drupal-8-mod... for further information.

Categories: Drupal

Nonprofit Drupal posts: April Drupal for Nonprofits Chat

Planet Drupal - 16 April 2019 - 8:42am

Our normally scheduled call to chat about all things Drupal and nonprofits will happen Thursday, April 18 at 1pm ET / 10am PT. (Convert to your local time zone.)

On the agenda this month is a report-back from DrupalCon Seattle -- including the Nonprofit Summit -- and anything else related to Drupal and nonprofits that's on our minds.

Feel free to share your thoughts and discussion points ahead of time in our collaborative Google doc: https://nten.org/drupal/notes

We have an hour to chat so bring your best Drupal topics and let's do this thing!

Some examples to get your mind firing: how do I recreate [feature] on my Drupal 7 site in Drupal 8? I need to explain [complicated thing] to a non-technical stakeholder -- any advice? How can I get Drupal and my CRM to play nicely?

This free call is sponsored by NTEN.org but open to everyone.

View notes of previous months' calls.

Categories: Drupal

OSTraining: How to Add Drupal Webforms to Content Types

Planet Drupal - 16 April 2019 - 8:40am

An OSTraining member asked us if it was possible to connect Webforms to their content.

I can imagine a lot of use-cases for this. For example, if you have an "Events" content type, you might want a form so visitors can contact the event organizer. Or if you have a "Business" content type, it might be useful for people to contact the business.

This can be done thanks to a module called "Webform Extra Field" and in this tutorial I'll show you how.

Categories: Drupal

Views Streaming Data

New Drupal Modules - 16 April 2019 - 7:39am

For Drupal 8.6.x and above only.

This module provides a views display type for CSV (+ JSON planned) for exporting large result sets using a streaming Response and limiting the amount of memory consumed by the entity system. The goal is to allow exporting 100k and larger result sets without running out of PHP memory.

Categories: Drupal

Promet Source: How to Simplify Setup of Complex Drupal Sites with Docker and Expresso PHP

Planet Drupal - 16 April 2019 - 7:14am
The ever increasing complexity and functionality of Drupal sites does not need to translate into increasingly steeper development costs. In the past, Drupal sites were relatively homogeneous with the occasional multi-domain or multi-site implementation. Today, as sites become more complex, with features such as headless integration with non-Drupal software, the overhead of reproducing an environment locally can become very costly.  Docker was created to bridge the gap between a homogeneous Drupal implementation and a complex integration with non-Drupal software.  
Categories: Drupal

Migrate Process Array

New Drupal Modules - 16 April 2019 - 7:09am
Categories: Drupal

Pages

Subscribe to As If Productions aggregator - Drupal