Skip to content

Instantly share code, notes, and snippets.

Avatar

Katherine Senzee ksenzee

View GitHub Profile
@mikecrittenden
mikecrittenden / import.php
Last active Sep 8, 2021
Importing Drupal 8 config programmatically
View import.php
<?php
// Import arbitrary config from a variable.
// Assumes $data has the data you want to import for this config.
$config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html');
$config->setData($data)->save();
// Or, re-import the default config for a module or profile, etc.
\Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module');
@rauchg
rauchg / README.md
Last active Feb 19, 2021
require-from-twitter
View README.md
View batch_yakety_sax.module
/**
* Implements hook_page_alter().
*/
function batch_yakety_sax_page_alter(&$page) {
if (current_path() == 'batch' && isset($_REQUEST['id']) && batch_load($_REQUEST['id'])) {
$page['content']['system_main']['yakety']['#markup'] = '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/playlists/28530082&amp;color=0066cc&amp;auto_play=true&amp;hide_related=false&amp;show_artwork=true"></iframe>';
}
}