$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);
$block_manager = \Drupal::service('plugin.manager.block');
** Not maintained **
For up-to-date references please see:
For 8.x-2.x branch: https://www.drupal.org/docs/contributed-modules/twig-tweak-2x/cheat-sheet
For the 3.x branch: https://git.drupalcode.org/project/twig_tweak/-/blob/3.x/docs/cheat-sheet.md
| <?php | |
| /** | |
| * Implemets hook_preprocess_node(). | |
| * | |
| * Create variable from translated taxonomy term name. | |
| * Code by @tikaszvince. | |
| */ | |
| function THEMENAME_preprocess_node(&$variables) { | |
| /** @var Drupal\node\Entity\Node $node */ |
[Update 2024] - Take a look at Drupal at your fingertips. Lot's of great stuff there.
// Load file object
$file = File::load($fid);| name: Modal Form Example | |
| type: module | |
| description: 'Modal Form Example module' | |
| package: Example | |
| version: VERSION | |
| core: 8.x |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm