Michael Eaton
Member
Hey guys,
When using my adsense account google kept nagging me to use their +1 button eventually I thought, why not?
I wanted it in the same place as the other social network-y type things under the "Share this page" section near the bottom of a view-thread page.
So I got what i wanted (http://www.hummy.tv/) click through on to a discussion/thread and you'll see at the bottom.
This is what I did.
First of all get your google +1 code:
http://www.google.com/webmasters/+1/button/
Once you have your code, you need to put the javascript in either in the <head> section or just above the </body>.
I used "footer" template and put it right at the bottom of the template after all code. It appears just above 2 jquery scripts then its </body> .. close enough I recon!
Save this change then go back to Templates and look for: "share_page".
This one is more awkward.. and a bit hacky! I didn't have time to add to any stylesheets so I cheated and used the class from the FacebookLike feature to give it the correct position and layout, otherwise the +1 button floats to the right.
You can put the button where you like, but I put it between the Twitter and Facebook icons this is the code you need:
Make sure you change the "size" to the size you want, but I believe the medium one matches the other social network plugin things..
Your code for the share_page should now look like this:
Now Save! That should be it! Hope this all makes sense!
Any questions hit reply and I'll try my best.
Regards,
Micahael
When using my adsense account google kept nagging me to use their +1 button eventually I thought, why not?
I wanted it in the same place as the other social network-y type things under the "Share this page" section near the bottom of a view-thread page.
So I got what i wanted (http://www.hummy.tv/) click through on to a discussion/thread and you'll see at the bottom.
This is what I did.
First of all get your google +1 code:
http://www.google.com/webmasters/+1/button/
Once you have your code, you need to put the javascript in either in the <head> section or just above the </body>.
I used "footer" template and put it right at the bottom of the template after all code. It appears just above 2 jquery scripts then its </body> .. close enough I recon!
Save this change then go back to Templates and look for: "share_page".
This one is more awkward.. and a bit hacky! I didn't have time to add to any stylesheets so I cheated and used the class from the FacebookLike feature to give it the correct position and layout, otherwise the +1 button floats to the right.
You can put the button where you like, but I put it between the Twitter and Facebook icons this is the code you need:
HTML:
<div class="facebookLike shareControl"><g:plusone size="medium"></g:plusone></div>
Make sure you change the "size" to the size you want, but I believe the medium one matches the other social network plugin things..
Your code for the share_page should now look like this:
HTML:
<xen:if hascontent="true">
<xen:require css="share_page.css" />
<div class="sharePage">
<h3 class="textHeading larger">{xen:phrase share_this_page}</h3>
<xen:contentcheck>
<xen:if is="{$xenOptions.tweet.enabled}">
<div class="tweet shareControl">
<a href="http://twitter.com/share" class="twitter-share-button"
data-count="horizontal"
data-lang="{xen:helper twitterLang, $visitorLanguage.language_code}"
data-url="{$url}"
{xen:if {$thread.title}, 'data-text="{$thread.title}"'}
{xen:if {$xenOptions.tweet.via}, 'data-via="{$xenOptions.tweet.via}"'}
{xen:if {$xenOptions.tweet.related}, 'data-related="{$xenOptions.tweet.related}"'}>{xen:phrase tweet}</a>
</div>
</xen:if>
<div class="facebookLike shareControl"><g:plusone size="medium"></g:plusone></div>
<xen:if is="{$xenOptions.facebookLike}">
<div class="facebookLike shareControl">
<xen:container var="$facebookSdk">1</xen:container>
<fb:like href="{$url}" show_faces="true" width="500" action="{$xenOptions.facebookLikeAction}" font="trebuchet ms" colorscheme="@fbColorScheme"></fb:like>
</div>
</xen:if>
</xen:contentcheck>
</div>
</xen:if>
Now Save! That should be it! Hope this all makes sense!
Any questions hit reply and I'll try my best.
Regards,
Micahael