Promet Source: 9 Ways Drupal Keeps Government Sites Ahead of the Curve

Note: This blog was first published on February 2, 2021, and has been updated to reflect new information and insights. Takeaway: Drupal is a powerful, open-source choice for government websites due to its advanced features and capabilities. It’s no secret that as an agency committed to bringing what’s new and next in the technology horizon to the public sector, we strongly advocate this choice. We’re in good company concerning this advocacy:

Electric Citizen: Big Changes Ahead for Drupal

Image removed.

Our team recently attended (and once again sponsored!) the DrupalCon North America conference in Portland, OR. 

Image removed.

This annual conference brings together the Drupal community, from the agencies who provide Drupal services to the industry clients who rely on it, along with contributors and open-source enthusiasts from around the world.

From my perspective on the exhibitors floor, working the booth, I don’t see as many of the great individual sessions that I have in past years. But I did leave with some important takeaways from this year’s event, especially around some upcoming changes for Drupal. 

Aten Design Group: Drupal API Development Simplified with APITools Module

Drupal API Development Simplified with APITools Module Image removed.jenna Tue, 05/14/2024 - 12:55 Drupal

One of Drupal’s most important features is its ability to integrate seamlessly with other systems (CRMs, eCommerce Platforms, Event Management Platforms, etc). Drupal can expose data using modules like JSON:API, which are integral parts of Drupal Core. Moreover, it can also consume data and make HTTP requests using standard HTTP methods. This post will focus primarily on the latter—highlighting how a module named APITools simplifies the process for Drupal developers.

Background

In researching the history of HTTP request handling in Drupal, I discovered that drupal_http_request has been around since version 5.x. It was described as:

"A flexible and powerful HTTP client implementation that correctly handles GET, POST, PUT, or any other HTTP requests, including handling redirects."

Throughout Drupal versions 6.x and 7.x, drupal_http_request continued to be a go-to option, seemingly simpler than using PHP's CURL function directly—a tool that many developers find intricate. With the release of Drupal 8, Drupal::httpClient replaced drupal_http_request, granting developers access to Guzzle—the de facto HTTP client in the PHP community.

While httpClient/Guzzle is typically the preferred choice for HTTP requests, it's rare that any request happens without some form of authentication. Although OAuth 2 has emerged as a standard for API authentication, the specifics can vary considerably between different APIs. This variability doesn’t mean the principles of OAuth 2 aren’t followed; rather, the implementations differ just enough that attempts to abstract this functionality into a universal module have faced challenges. As a result, developers frequently find themselves writing slightly different code for each API integration to accommodate these nuances. APITools attempts to be just helpful enough in these sorts of situations without making too many assumptions.

Leveraging APITools for the Drupal Zoom API Module

I personally maintain the Drupal Zoom API module, and over the past year, Zoom has changed their authentication requirements. This challenge prompted me to explore the APITools module, maintained by my friend and colleague Alan Sherry. What attracted me most to APITools was its ability to offer configurable options for storing credentials and an extensible client plugin that routes all API requests through a specified authentication method. By using APITools, I significantly reduced the amount of code in the Zoom API module and quickly released a version 3.x, which is compatible with Zoom’s "Server-to-Server OAuth" authentication method. The configuration form and the majority of the API client are now provided by APITools, reducing the amount of code I’ll need to maintain in the Zoom API module.

If you, like me, maintain an API-focused contrib module or need a reliable HTTP client for one-off tasks, I highly encourage you to explore APITools. With a little setup time, you can configure your ApiToolsClient and start making requests effortlessly.

The fact is, there are numerous API client modules on Drupal.org, each tailored for different services. APITools offers an opportunity for a more consistent and efficient approach. I hope you'll check it out!

Getting Started / Examples

We've written some documentation on Drupal.org for you to reference. For a fairly complete example in the Drupal contrib space, checkout the client plugin that is part of the Zoom API module.

Additional Examples

We’ve created a repository with some various API clients that will hopefully help with getting started.

  • Acalog - Simple api key implementation
  • Auth0 - Access token request with audience and grant type
  • Brandfolder - An example of using an sdk as a base with an apitools client wrapper around it
  • Localist - Example of a static access token created by an administrator
  • Sharepoint - Access token with audience / grant type, and “ext_expires_in” instead of “expires_in”

If you decide to use APITools, we’d love to hear about your experience in the blog comments below.

Image removed.Joel Steidl

PreviousNext: Starshot and Experience Builder

Last week, I attended DrupalCon Portland 2024, and, like many others, I was swept up in the excitement of the Starshot announcement. The PreviousNext team is ready to support this initiative, focusing our efforts on the Experience Builder project for maximum impact.

by kim.pepper / 16 May 2024

Starshot

Starshot is a new concept that accelerates Drupal innovation by providing recipes or templates of best-practice features and configurations when creating a new Drupal site. It’s a separate product built on top of Drupal Core and has the working title “Drupal CMS”.

For years, we’ve pondered the question, “Is Drupal a product or a framework?” The answer has always been “both.” However, we can now clearly distinguish between the two.

We’re fully committed to the vision of bringing Drupal to new audiences by offering a straightforward way to create new Drupal sites using best-practice contributed modules and configuration. Combining Recipes with Project Browser, Automated Updates, and the new Experience Builder initiative will demonstrate Drupal’s full potential for product evaluators.

Releases for Drupal CMS will not be tied to Drupal Core, allowing it to innovate rapidly and evolve as contributed module updates and new best practices emerge. Drupal Core can simultaneously focus on maintaining quality and stability.

Image removed.

Experience Builder

Experience Builder is an ambitious initiative to reinvent how we build pages (experiences) in Drupal.  Core committer Lauri Eskola undertook an extensive review of our own tools (Layout Builder, Paragraphs) and research into competing products to find a model that would best combine innovative user interface design with Drupal’s strengths in structured data.

Our team is in a strong and unique position to meaningfully contribute to the Experience Builder initiative. We have successfully delivered the Pitchburgh competition winner Decoupled Layout Builder prototype. We also provided numerous contributions to Layout Builder in core and contributed modules.

Experience Builder will become our primary contribution focus for the short and medium term, so watch this space.

We hope you are as excited as we are about the future of Drupal. We’re just getting started!

The Drop Times: Policy-Based Access in Core by Kristiaan Van den Enyde

Kristiaan Van den Eynde, Senior Drupal Developer at Factorial, has made substantial contributions to Drupal, including the widely-used Group module and VariationCache. His project, Policy-Based Access in Core, introduced a dynamic system for managing permissions based on predefined policies. This initiative, set to debut in Drupal 10.3, promises enhanced flexibility and security. Kristiaan shares insights into his development process, the challenges faced, and the future of access control in Drupal.

Tag1 Consulting: Migrating Your Data from Drupal 7 to Drupal 10 using the Migrate API: Avoiding entity ID conflicts

By default, the Drupal 7 to 10 upgrade path preserves entity IDs. In the previous article, we explained that this would cause problems if content or configuration already exists in the destination Drupal 10 site. Let’s explore this further and evaluate ways to work around the issue.

Read more mauricio Wed, 05/15/2024 - 14:15

Debug Academy: How to create custom sorting logic for Drupal views

How to create custom sorting logic for Drupal views

Drupal websites sometimes have a need to implement more advanced sorting logic than what's available out of the box.

One of our career-changing Drupal training course alumni asked me how to handle this today. After answering them, I decided to copy the answer into a blogpost.

The views module creates dynamic queries for us based on the configuration options we select. The UI essentially allows us to use any field for sorting in ascending (smallest to largest) or descending (largest to smallest) order. This is extremely helpful and covers the vast majority of use cases - date sorting, alphabetical sorting, and numeric sorting are all supported - but we sometimes run into limitations when we have more complicated requirements.

Some examples of these scenarios include:

ashrafabed Wed, 05/15/2024