Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Is it possible to use a custom image for the PinIt button? I didn't find any valuable information about this, and I already use a custom folder with my images but the pinterest one (pinterest.png) doesn't get picked.
Thanks in advance
Comment | File | Size | Author |
---|---|---|---|
#9 | service_links-pinterest_icon-1664076-9.patch | 2.86 KB | jenlampton |
#8 | service_links-pinterest_icon-1664076-8.patch | 2.84 KB | jenlampton |
Comments
Comment #1
chromix CreditAttribution: chromix commentedThe button is loaded dynamically directly from Pinterest. You'd need to have a non-widget share link specifically for Pinterest. I don't think Pinterest supports anything like that. Anyone know otherwise?
Comment #2
FranCarstens CreditAttribution: FranCarstens commentedI've gotten pretty close...
By adding the following under general service I am getting everything except the node image.
If I could somehow call out the image URL this would work perfectly using the following:
Anybody know how to pull that image url in?
Comment #3
TheCrow CreditAttribution: TheCrow commented@FranCarstens the 'preset' field and related function is what you need.
Comment #4
FranCarstens CreditAttribution: FranCarstens commentedThanks Crow. :D
Comment #5
Vali Hutchison CreditAttribution: Vali Hutchison commented@FranCarstens Any chance of providing the working code you used to for the custom Pinterest icon?
Comment #6
sethfreach CreditAttribution: sethfreach commented@SlakerD, Rather than making a patch, a new small module was better for my needs. below is an example of service_links_pinterest.module that I'm using to create a simple Pinterest service link. I could make a project page out of it, but I think it's best folded into service_links, rather than continue as a stand alone module. There are a few opportunities in the code to specify the image based on the current node: directly in the service_links_pinterest_preset() function or by implementing a hook anywhere else with hook_service_links_pinterest_NODE_TYPE().
Comment #7
FranCarstens CreditAttribution: FranCarstens commented@Vali Hutchison
My workaround is unfortunately somewhat hardcoded, but it works. With a little work it should be possible to improve on it, but my php knowledge is lacking. I have the following:
I've added the following to the bottom of the general_services.module around line 142, in the "general_services_service_links" function:
Then I broke some rules and added the following to the service_links.module:
Around line 708, in the "_service_links_get_tags" function:
Then, around line 770, in the "$settings['tag'] = array(" I added the following:
And again around line 806 in the "$settings['subst'] = array(" I added the following:
Anybody who knows about coding will realise I have no idea what I'm doing, but, again, this worked for me.
You can change the icon using css background.
I am using:
version = "7.x-2.1+16-dev"
core = "7.x"
project = "service_links"
datestamp = "1362317389"
You can see it in use here: http://sqz.ee/Zk7
Comment #8
jenlamptonHere's a patch made from a similar approach in #7
Comment #9
jenlamptonsmall change to prevent PHP error on non-node pages.
Comment #10
Reuben Unruh CreditAttribution: Reuben Unruh commented#9 is working
Comment #11
cmseasy CreditAttribution: cmseasy commented#9 worked for me