Skip to content

Instantly share code, notes, and snippets.

View flocondetoile's full-sized avatar

Flocon de toile flocondetoile

View GitHub Profile
@flocondetoile
flocondetoile / OpiToolsCommands.php
Created January 14, 2021 10:53 — forked from opi/OpiToolsCommands.php
Drupal9 - Create field_group from drush command
<?php
namespace Drupal\opitools\Commands;
use Drush\Commands\DrushCommands;
use Drupal\Core\Language\LanguageInterface;
/**
* A Drush commandfile.
*
@flocondetoile
flocondetoile / Blocks.md
Created February 27, 2021 11:37 — forked from bdlangton/Blocks.md
Drupal 8 programmatic solutions

Render custom blocks

$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);

Render plugin blocks

$block_manager = \Drupal::service('plugin.manager.block');
@flocondetoile
flocondetoile / drupal_sticky_nav_with_debounce.md
Created May 6, 2021 09:04 — forked from opi/drupal_sticky_nav_with_debounce.md
Drupal : Sticky navigation with debounce

In yourtheme.libraries.yml

global:
  js:
    dist/js/global.js: { minified: true }
  dependencies:
    - core/drupal
    - core/drupal.debounce