Blog Archives

Block Caching “Gotcha” in Drupal 8

I recently had a fight with the Block system in Drupal 8. To be brief, if you’re trying to disable caching on a block, make sure to set the #cache element regardless of whether the block has output or not.

Tagged with: , ,
Posted in Development

Passing Arguments to Drupal Blocks

You can pass any number of arguments to a Drupal block by providing default arguments. The screenshot below shows what an argument might look like in Views2.

Tagged with: , , ,
Posted in Development

Using module_list() to show active Drupal modules

This code can be used in a custom module, a template.php file, or most easily in a block. This looks good in the header bar on a demo site, without a title, as you can see in the screenshot! The

Tagged with: , , , ,
Posted in Development