Skip to content

Commit

Permalink
chore(SLB-415): unset the preview button from the toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
colorfield committed Jun 20, 2024
1 parent 6dba0f5 commit 56bf8e7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/drupal/gutenberg_blocks/gutenberg_blocks.module
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,16 @@ function gutenberg_blocks_form_node_form_alter(&$form, FormStateInterface $form_
$form['#attached']['drupalSettings']['customGutenbergBlocks']['forms'] = array_values($forms);
}
}

/**
* Implements hook_toolbar_alter().
*/
function gutenberg_blocks_toolbar_alter(&$items) {
// Unset the preview button from the toolbar for now,
// as it's a duplicate of the one in the editor.
// This could be configurable in the silverback_external_preview module
// based on routes.
if (array_key_exists('silverback_external_preview', $items)) {
unset($items['silverback_external_preview']);
}
}

0 comments on commit 56bf8e7

Please sign in to comment.