94% of attendees gave my session a 5 star (79%) or 4 star (15%) rating.
Bamboo Twig is a great Drupal module which gives you a lot of extra Twig functions to work with Drupal specific functionality in Twig without needing to write a lot of preprocess function code (in PHP).
It allows you to do things like render views, blocks, regions, entities (with view…
This is a list I put together while doing research while we were considering a trial of utility-first CSS in the Drupal team at CTI Digital (and have since kept relatively up-to-date). I’ve posted the list here to make it easier to refer to in the future. …
I’d always known about Kint, but I’d never really used it until recently. The standard
dump(thing_to_dump) command was good enough, but a conversation on the Drupal Twig Slack channel reminded me that Kint shows available methods on an object, and that was good enough to prompt me to switch.
Aleksip’s Data Transform Plugin (DTP) is a tremendous tool for people using Pattern Lab and Drupal together. It allows you to emulate Drupal’s
Url objects, which is really useful when creating Twig templates that will be consumed by both Pattern Lab and Drupal.
At work I’m one sprint into a new project where we have decided to use Pattern Lab and component-based design for the first time. It’s going really well, and I’m learning a lot. As a frontend developer it’s great to finally have control of the markup coming from Drupal, and…
Some notes for the Manchester FRED show and tell session:
Note: the beta.lasttramfrom.co.uk URL is no longer valid, just use https://lasttramfrom.com instead.
Views in Drupal doesn’t seem to support a contextual filter value overriding the
<title> of a view being displayed as a page. The heading on the page changes, but the title in the
<head> of the document isn’t altered.
Here’s one way how to have a custom module take the view title (with the contextual filter override correctly inserted) and apply it to the route (page) title:
(Note that that is a very targeted
hook_views_post_render function in a specific custom module and so it bails out early if the ID and display don’t match what we’re looking for. In a more general module you’d want to remove the early return call and instead wrap lines 13–15 in another if statement)