Skip to content

Instantly share code, notes, and snippets.

@jenitehan
Last active July 3, 2017 16:40
Show Gist options
  • Save jenitehan/66645a0630dc69965a2f06e87edb98d9 to your computer and use it in GitHub Desktop.
Save jenitehan/66645a0630dc69965a2f06e87edb98d9 to your computer and use it in GitHub Desktop.
Load a Drupal 8 config, override some settings, save new config.
<?php
// This will load the view from config, set a new name and ID, then change the vocabulary to tags.
$config = \Drupal::configFactory()->getEditable('views.view.blog_categories');
$config->setName('views.view.blog_categories_tags');
$config->set('id', 'blog_categories_tags');
$config->set('display.default.display_options.filters.vid.value', ['tags' => 'tags']);
$config->save(TRUE);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment