Skip to content
Snippets Groups Projects
Commit 69b9faf1 authored by mschudders's avatar mschudders Committed by Damien McKenna
Browse files

Issue #2760395 by DamienMcKenna, Mschudders: Pinterest widget doesn't work.

parent 61590482
Branches
Tags
No related merge requests found
......@@ -14,6 +14,8 @@ Easy Social 8.x-3.x-dev, 2022-xx-xx
#2782133 by DamienMcKenna, klontje85: Facebook like button doesn't work.
#3268249 by DamienMcKenna: Add a CHANGELOG.txt.
#3268250 by DamienMcKenna: Remove support for Drupal 8.
By DamienMcKenna: Fixed file permissions.
#2760395 by DamienMcKenna, Mschudders: Pinterest widget doesn't work.
Easy Social 8.x-3.0, 2016-06-26
......
......@@ -315,7 +315,33 @@ JS;
$attributes['data-counter'] = $widget_params['counter'];
}
}
$variables['attributes'] = $attributes;}
$variables['attributes'] = $attributes;
}
/**
* Implements hook_preprocess_HOOK() for easy_social_pinterest.
*/
function easy_social_preprocess_easy_social_pinterest(&$variables, &$hook) {
// @todo Elaborate with: https://developers.pinterest.com/docs/widgets/pin-it/
$hook = str_replace('easy_social_', 'easy_social.', $hook);
if ($config = \Drupal::config($hook)) {
// @todo Load contextual config.
$widget_params = $config->get();
if (!empty($widget_params['url'])) {
$variables['image'] = $widget_params['image'];
}
if (!empty($widget_params['description'])) {
$variables['description'] = $widget_params['description'];
}
}
if (empty($variables['image'])) {
$variables['image'] = '//assets.pinterest.com/images/pidgets/pin_it_button.png';
}
}
/**
* Implements hook_preprocess_HOOK() for easy_social_email theme.
......
......@@ -8,9 +8,11 @@
* - widgets: The widgets to be rendered.
* - async: If we want to render JS ASsynchronously.
* - attached: Array of libraries to add, according to the widget definition.
* - image: The URL for the pin it button.
* - description: A description filled in by the user.
*
*/
#}
<div class="easy-social pinterest">
<a href="//pinterest.com/pin/create/button" {{ attributes }}></a>
</div>
\ No newline at end of file
<a data-pin-do="buttonBookmark" href="https://www.pinterest.com/pin/create/button/"></a>
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment