You are here

function gutenberg_views_pre_render in Gutenberg 8.2

Same name and namespace in other branches
  1. 8 gutenberg.module \gutenberg_views_pre_render()

Implements hook_views_pre_render().

File

./gutenberg.module, line 804
Provides integration with the Gutenberg editor.

Code

function gutenberg_views_pre_render(ViewExecutable $view) {
  if ($view
    ->id() == "reusable_blocks" && $view->current_display == 'page_1') {

    // Attached Gutenberg's basic style to reusable blocks view.
    $view->element['#attached']['library'][] = 'gutenberg/admin';
    $view->element['#attached']['library'][] = 'gutenberg/blocks-view';
  }
}