You are here

function template_preprocess_facebookshare in Facebook Share 8

Prepares variables for color scheme form templates.

Default template: color-scheme-form.html.twig.

Parameters

array $variables: An associative array containing:

  • form: A render element representing the form.

File

./facebookshare.module, line 89
Adds a button to a node to share on a user's Facebook stream.

Code

function template_preprocess_facebookshare(&$variables) {
  $config = \Drupal::config('facebookshare.settings');
  $settings = $config
    ->get();
  $variables['app_id'] = Html::escape($settings['facebookshare_app_id']);
  $variables['layout'] = Html::escape($settings['facebookshare_layout']);
  $variables['size'] = Html::escape($settings['facebookshare_size']);
  $variables['width'] = Html::escape($settings['facebookshare_width']);
  $variables['height'] = Html::escape($settings['facebookshare_height']);
  $variables['mobile_iframe'] = !empty($settings['facebookshare_mobile_iframe']) ? 'true' : 'false';
}