Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
easy_social
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
easy_social
Commits
69b9faf1
Commit
69b9faf1
authored
3 years ago
by
mschudders
Committed by
Damien McKenna
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2760395
by DamienMcKenna, Mschudders: Pinterest widget doesn't work.
parent
61590482
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.txt
+2
-0
2 additions, 0 deletions
CHANGELOG.txt
easy_social.module
+27
-1
27 additions, 1 deletion
easy_social.module
templates/easy-social-pinterest.html.twig
+4
-2
4 additions, 2 deletions
templates/easy-social-pinterest.html.twig
with
33 additions
and
3 deletions
CHANGELOG.txt
+
2
−
0
View file @
69b9faf1
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
easy_social.module
+
27
−
1
View file @
69b9faf1
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
templates/easy-social-pinterest.html.twig
+
4
−
2
View file @
69b9faf1
...
...
@@ -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>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment