Drupal News

Darren Oh: A shared slide show for local Drupal events

Main Drupal Feed - Wed, 06/29/2022 - 20:01
A shared slide show for local Drupal events Darren Oh Wed, 06/29/2022 - 16:01

Darren Oh: A shared slide show for local Drupal events

Main Drupal Feed - Wed, 06/29/2022 - 20:01
A shared slide show for local Drupal events Darren Oh Wed, 06/29/2022 - 16:01

Lullabot: Making the Most of Display Modes In Drupal

Main Drupal Feed - Wed, 06/29/2022 - 14:03

One of Drupal's biggest strengths is the ability to define structured content, then display and edit it in a variety of ways without duplicating development or design work. "Display Modes" have always been a big part of that power. One piece of content can be displayed as a Teaser, as a Full Page, as a Search Result, and so on — each with its own markup and field presentation.

ComputerMinds.co.uk: PhpStorm coding tip for Drupal services

Main Drupal Feed - Wed, 06/29/2022 - 12:56

Here's a super simple tip to help you work with services for Drupal in PhpStorm (our favourite IDE). First, ensure you have enabled the Drupal Symfony Bridge and Symfony Support plugins; they're brilliant for auto-complete suggestions, and navigating around services, controllers, annotations and twig templates! I find it so helpful to be able to cmd+click (or ctrl+click) on a service name, whether in a YAML definition, or PHP code, and jump straight to the service class. But I'd noticed that PhpStorm often didn't recognise the method used after my code referred to a service like this:

\Drupal::service('my_service') ->something($id);

That meant PhpStorm couldn't give me hints about what parameters the '->something()' method should take, or even auto-complete what methods are available on the service.

I discovered this is probably because the doxygen for the return type of \Drupal::service() is simply 'mixed'. Or perhaps because the Symfony plugin just isn't aware of this Drupalism.

Instead, if I change my code to the following, PhpStorm suddenly understands what the service is, so it can help me code more easily!

\Drupal::getContainer() ->get('my_service') ->something($id);

This is barely any more code, but suddenly I can click into the definition of the ->something() method, and get all the IDE functionality I normally expect. Win!

Here's how it actually looks for me, demonstrating the inline parameter hint, and with PhpStorm's 'Quick documentation' tooltip opened (press F1 to get this). This is super handy - especially for methods with a ton of parameters!

Of course, this only really matters when you're forced to get the service via the \Drupal class, rather than dependency injection, such as in static/procedural code. Which might be discouraged, but I doubt will ever be entirely eliminated, especially in custom code which might often be a bit more 'quick & dirty', by necessity.

You could always just add /** @var ... */ doxygen comments around your code to help inform PhpStorm of what a service is. I've seen more and more of that sprinkled around contrib & core code. But I figure this new approach is the simplest to change existing code to, as it's only a very small and less obtrusive change. Plus it allows PhpStorm to dynamically understand your code, rather than you having to teach it. Which allows you to get on with your actual work instead, of writing awesome code.

What do you reckon? Is this a new pattern we should all start using more?

The Drop Times: 10 Essential SEO Modules

Main Drupal Feed - Tue, 06/28/2022 - 00:16
Here are 10 essential Drupal 9 SEO modules that will help you address many of your SEO problems immediately.

The Drop Times: 10 Essential SEO Modules

Main Drupal Feed - Tue, 06/28/2022 - 00:16
Here are 10 essential Drupal 9 SEO modules that will help you address many of your SEO problems immediately.

The Drop Times: 10 Essential SEO Modules

Main Drupal Feed - Tue, 06/28/2022 - 00:16
Here are 10 essential Drupal 9 SEO modules that will help you address many of your SEO problems immediately.

The Drop Times: 10 Essential SEO Modules

Main Drupal Feed - Tue, 06/28/2022 - 00:16
Here are 10 essential Drupal 9 SEO modules that will help you address many of your SEO problems immediately.

The Drop Times: 10 Essential SEO Modules

Main Drupal Feed - Tue, 06/28/2022 - 00:16
Here are 10 essential Drupal 9 SEO modules that will help you address many of your SEO problems immediately.

Factorial.io: Celebrating a new major Group version

Main Drupal Feed - Tue, 06/28/2022 - 00:00

Group has just got its first alpha release for the 2.0.0 version and we wanted to seize the opportunity to celebrate that by looking back at where we came from and forward to where we still plan on going.

Factorial.io: Celebrating a new major Group version

Main Drupal Feed - Tue, 06/28/2022 - 00:00

Group has just got its first alpha release for the 2.0.0 version and we wanted to seize the opportunity to celebrate that by looking back at where we came from and forward to where we still plan on going.

Factorial.io: Celebrating a new major Group version

Main Drupal Feed - Tue, 06/28/2022 - 00:00

Group has just got its first alpha release for the 2.0.0 version and we wanted to seize the opportunity to celebrate that by looking back at where we came from and forward to where we still plan on going.

Factorial.io: Celebrating a new major Group version

Main Drupal Feed - Tue, 06/28/2022 - 00:00

Group has just got its first alpha release for the 2.0.0 version and we wanted to seize the opportunity to celebrate that by looking back at where we came from and forward to where we still plan on going.

Factorial.io: Celebrating a new major Group version

Main Drupal Feed - Tue, 06/28/2022 - 00:00

Group has just got its first alpha release for the 2.0.0 version and we wanted to seize the opportunity to celebrate that by looking back at where we came from and forward to where we still plan on going.

Factorial.io: Celebrating a new major Group version

Main Drupal Feed - Tue, 06/28/2022 - 00:00

Group has just got its first alpha release for the 2.0.0 version and we wanted to seize the opportunity to celebrate that by looking back at where we came from and forward to where we still plan on going.

Factorial.io: Celebrating a new major Group version

Main Drupal Feed - Tue, 06/28/2022 - 00:00

Group has just got its first alpha release for the 2.0.0 version and we wanted to seize the opportunity to celebrate that by looking back at where we came from and forward to where we still plan on going.

Factorial.io: Celebrating a new major Group version

Main Drupal Feed - Tue, 06/28/2022 - 00:00

Group has just got its first alpha release for the 2.0.0 version and we wanted to seize the opportunity to celebrate that by looking back at where we came from and forward to where we still plan on going.

Talking Drupal: Talking Drupal #353 - Native Web Components

Main Drupal Feed - Mon, 06/27/2022 - 18:00

Today we are talking about Web Components with Ron Northcutt.

www.talkingDrupal.com/353

Topics
  • What are native web components
  • How are they different from custom elements
  • How are they different from JS frameworks
  • Libraries
    • Elix
    • Bit
    • Polymer
    • Lit
  • ShadowDOM
  • Difference between Progressive Web App and NWC
  • Benefits of NWC
  • How do you use them
  • What are lifecycle callbacks
  • Styles
  • Html
  • Slots
    • named
    • anonymous
  • Support for NWCs
  • Use cases
  • Anything else?
Resources Guests

Ron Northcutt - @rlnorthcutt

Hosts

Nic Laflin - www.nLighteneddevelopment.com @nicxvan John Picozzi - www.epam.com @johnpicozzi Donna Bungard - @dbungard

MOTW

Menu block This module provides configurable blocks of menu links with additional features not available in Drupal 8+ core.

Talking Drupal: Talking Drupal #353 - Native Web Components

Main Drupal Feed - Mon, 06/27/2022 - 18:00

Today we are talking about Web Components with Ron Northcutt.

www.talkingDrupal.com/353

Topics
  • What are native web components
  • How are they different from custom elements
  • How are they different from JS frameworks
  • Libraries
    • Elix
    • Bit
    • Polymer
    • Lit
  • ShadowDOM
  • Difference between Progressive Web App and NWC
  • Benefits of NWC
  • How do you use them
  • What are lifecycle callbacks
  • Styles
  • Html
  • Slots
    • named
    • anonymous
  • Support for NWCs
  • Use cases
  • Anything else?
Resources Guests

Ron Northcutt - @rlnorthcutt

Hosts

Nic Laflin - www.nLighteneddevelopment.com @nicxvan John Picozzi - www.epam.com @johnpicozzi Donna Bungard - @dbungard

MOTW

Menu block This module provides configurable blocks of menu links with additional features not available in Drupal 8+ core.

Talking Drupal: Talking Drupal #353 - Native Web Components

Main Drupal Feed - Mon, 06/27/2022 - 18:00

Today we are talking about Web Components with Ron Northcutt.

www.talkingDrupal.com/353

Topics
  • What are native web components
  • How are they different from custom elements
  • How are they different from JS frameworks
  • Libraries
    • Elix
    • Bit
    • Polymer
    • Lit
  • ShadowDOM
  • Difference between Progressive Web App and NWC
  • Benefits of NWC
  • How do you use them
  • What are lifecycle callbacks
  • Styles
  • Html
  • Slots
    • named
    • anonymous
  • Support for NWCs
  • Use cases
  • Anything else?
Resources Guests

Ron Northcutt - @rlnorthcutt

Hosts

Nic Laflin - www.nLighteneddevelopment.com @nicxvan John Picozzi - www.epam.com @johnpicozzi Donna Bungard - @dbungard

MOTW

Menu block This module provides configurable blocks of menu links with additional features not available in Drupal 8+ core.

Pages