I am trying to add some sharebuttons to my page, but I have Problems with the Google+ Button.
I actually just use the ones suggested on http://getkirby.com/docs/solutions/share-buttons. They all share the current page except for the Google+ one. Here a new post is opened, but it is empty. Did I miss something here?
What is the HTML output (in source, not tree view) of the button?
Do you mean this?
<a class="footer__shareoption__google" href="https://plusone.google.com/_/+1/confirm?hl=de&url=http%3A%2F%2Flocalhost%3A8888%2Fkirby&title=%C3%9Cber%20uns" target="blank" title="Google+">Google+</a>
That looks good, but as I don’t use Google+ I can’t verify why that doesn’t work. Maybe the sharing URL is not supported anymore.
Could you please try the following code:
<a href="https://plus.google.com/share?url=<?php echo rawurlencode($page->url()); ?>" target="blank" title="Share on Google+">Share on Google+</a>
Hmm… that does not seem to make a difference. It is still empty.
Can someone else confirm this? Because this is an official Google+ sharing URL.
This works for me, however, you should keep in mind that these links will only redirect you to a form to share the current page (which is still a good solution in terms of data security as no request will be sent to Google’s servers until you click on the link).
The form should look like this:
Okay, now I’m confused: The button does take me to a form like shown only not with the big G but a little spinning ball that does not seem to stop ever (waited for some minuets and my internet is not that slow…).
Plus I was expecting something like this like with the twitter share button where you can see the Link to the page. But I guess that would the big G in this case do?
Could it be that Google+ checks the link? Cause I am still running my program locally, which has no influence on twitter/facebook (they just write localhost:8888/whatsoever), but if Google+ tries ‘finding the link on the internet’ it of course could not do so.
Could this be the cause?
No, it should work from localhost as well, I have used this link in the past and still working:
<a href="https://plusone.google.com/_/+1/confirm?hl=de&url=<?php echo rawurlencode($page->url()); ?>" target="_blank">Google</a>
It should work from localhost, but it obviously won’t display anything in place of the Google G because Google can’t access the site on your local computer.
That’s right, all you get is the comment input and a color-changing loading .gif instead of the link.
Okay perfect! Thank you so much!