You are here

function gatsby_preview_node_entity_builder in Gatsby Live Preview & Incremental Builds 8

Same name and namespace in other branches
  1. 2.0.x gatsby.module \gatsby_preview_node_entity_builder()

Custom handler for Gatsby preview option.

1 string reference to 'gatsby_preview_node_entity_builder'
gatsby_form_alter in ./gatsby.module
Implements hook_form_alter().

File

./gatsby.module, line 129
Contains gatsby.module.

Code

function gatsby_preview_node_entity_builder($entity_type, ConfigEntityInterface $config_entity, &$form, FormStateInterface $form_state) {

  // Save Preview setting.
  $config_entity
    ->setThirdPartySetting('gatsby', 'preview', $form_state
    ->getValue('gatsby_preview'));
  $config_entity
    ->setThirdPartySetting('gatsby', 'target', $form_state
    ->getValue('gatsby_preview_target'));
  $config_entity
    ->setThirdPartySetting('gatsby', 'iframe', $form_state
    ->getValue('gatsby_iframe'));
}