Skip to content

Instantly share code, notes, and snippets.

View ksenzee's full-sized avatar

Katherine Senzee ksenzee

View GitHub Profile
@crittermike
crittermike / import.php
Last active August 11, 2023 10:39
Importing Drupal 8 config programmatically
<?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 January 6, 2024 07:19
require-from-twitter
/**
* 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>';
}
}