Skip to main content

Sam Becker

Senior Developer

Location

Perth

Sam is a back-end Drupal developer.

My blog posts

Launching an AJAX modal from a WYSWIYG link and customising the response with MainContentRendererInterface in Drupal 8

by Sam Becker /

On a recent project a feature was requested to allow admins to launch some content within a modal window from the WYSWIYG on a Drupal 8 website. The goals were as follows:

  • Open any content on the site in a modal window.
  • Fall back to a plain link for search engines and non-js based browsers.
  • Implement a branded modal design.

This is how we accomplished it.

Read the full post

Skinning HTML emails with Drupal using an existing front-end

by Sam Becker /

A requirement that comes up from time to time is being able to use content stored in Drupal and produce rich HTML emails. In a lot of cases the design of these emails matches the design of the existing, already implemented front-end website.

In a recent project, we explored ways of creating HTML email’s which wouldn’t require us to start from scratch and would also evolve as the website’s look and feel did. Our design goals were thus:

  • Use the existing website’s CSS to skin the emails.
  • Use existing Drupal site-building tools to construct the markup for these emails.
  • Allow admins to easily create and preview HTML emails.
Read the full post

Decorated services in Drupal 8

by Sam Becker /

One of the aspects of the new object oriented architecture in Drupal 8 is the introduction of services. Services can be provided by any module and provide a mechanism for exposing reusable functionality by way of interfaces and classes. All services are instantiated via the container which is responsible for injecting a service’s dependencies.

Since services implement interfaces and are always instantiated via the container, we have the opportunity to alter what the container returns, ultimately allowing us to swap any existing service with a new one.

Read the full post

Pagination