Blog

Fresh off the Blog

Unmanaged Files - Part 6

Tutorial
Tutorial Series • Part 6 of 6 • by Jeff Greenberg (The Accidental Coder)

This tutorial concludes the Unmanaged Files in Drupal series. In Part 1 we explored what unmanaged files are and when to use them. Part 2 built the foundation for our custom module and introduced the first file handler.

Unmanaged Files - Part 5

Tutorial

Part 5: Enhancing the Twig Function for Unmanaged Files

In Part 4, we rendered unmanaged files through a Twig template defined in the module. In this part, we’ll expand that flexibility by upgrading the Twig function introduced earlier so that theme authors can decide whether they want a URL or a fully rendered image tag—right from Twig.

Unmanaged Files - Part 4

Tutorial

Part 4: Using a Twig Template to Render Unmanaged Files

In Part 3 we exposed the file handler through a Block Plugin, letting site builders drop the output into regions via the UI. That works great for flexibility, but sometimes you want tighter control: a fixed piece of markup directly in a page template, not dependent on the block system at all.

Above Ground - Vol 1 Issue 5

Unmanaged Files - Part 3

Tutorial

Part 3: Rendering an Unmanaged File in a Block

In Part 2, we built a service that can locate unmanaged files and return one at random. In this part, we’ll expose that functionality as a block plugin. Blocks are a powerful way to make custom logic reusable: site builders can place them anywhere through the Drupal block layout interface, no code changes required.