Adding a Google PlusOne-Button

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
10/16/2011 11:41:51 AM
Gravatar
Total Posts 383
Thanks Squire Dude

Adding a Google PlusOne-Button

Hi,

What is your suggestion for the best method to add a Google PlusOne-Button to the bottom of pages so that it is in-line with the twitter & Facebook buttons?

The source code Google provides is...
<!-- Place this tag where you want the +1 button to render -->
<g:plusone annotation="inline"></g:plusone>

<!-- Place this render call where appropriate -->
<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>

Thanks

10/16/2011 1:48:58 PM
Gravatar
Total Posts 18439

Re: Adding a Google PlusOne-Button

Hi Phill,

You can use our built in control to add a google plus button in your layout.master file, that would add it to all pages that use the skin.

Hope that helps,

Joe

10/16/2011 2:14:11 PM
Gravatar
Total Posts 383
Thanks Squire Dude

Re: Adding a Google PlusOne-Button

Hi Joe A,

Thanks, it does help a lot... thanks for the pointer.

Phill

10/17/2011 10:41:33 AM
Gravatar
Total Posts 383
Thanks Squire Dude

Re: Adding a Google PlusOne-Button

Hi Joe A,

I have opened the Layout.Master file in VS 2010 and in looking at the code I see the ContentPlacholder sections but to not see any tags for the facebook of any of the other buttons.

Can you give ne a hint on where it is best to insert the PlusOne code?

Thanks

10/17/2011 4:56:57 PM
Gravatar
Total Posts 2239

Re: Adding a Google PlusOne-Button

Hi Phill,

It really depends on where in your design you think people are most likely to find it. Usually, it is placed in the Header or the Footer.

Once you have it placed, you'll probably need to adjust CSS to make it look right. I would probably put it at the bottom of the layout.master (before the closing form tag) and then use CSS to position it absolutely over the header image on the right hand side. Placing it at the bottom makes it less important, SEO wise. But, again, it is really your preference.

HTH,
Joe D.

10/17/2011 6:12:26 PM
Gravatar
Total Posts 383
Thanks Squire Dude

Re: Adding a Google PlusOne-Button

Hi Joe D,

Thanks for the thoughts.  I agree with all you noted above. 

As for placement I would like it to be at the bottom of the page next to the twitter & Facebook links - so they are all together... I was unable to locate where on the Layout.Master the twitter & Facebook icons appear?  Can you give me a hint?

You mentioned that the placement of the twitter, Facebook, & PlusOne buttons at the bottom of the page give SEO a lesser value... as a total novice on this SEO stuff I am open to all knowledge on what works and doesn't.  Does that mean then that I should effort to relocate all the social icons (links) to the top of the page to gain a higher ranking?

10/20/2011 9:56:32 AM
Gravatar
Total Posts 2239

Re: Adding a Google PlusOne-Button

Hi Phill,

I looked at your YachtLogSoftware.com site and it doesn't appear that you have the Twitter and Facebook controls in the layout.master, you instead are using the HTML Content Module to place Twitter and Facebook scripts at the bottom of the Home page only.

If you want Twitter, Facebook and Google Plus controls at the bottom of every page, you'll need to place the controls in the layout.master. You said you want them in the footer so I suggest placing them in the art-footer-text div. I don't think we have good documentation on these controls so I'll write something up and post a link.

As far as SEO goes, content at the top of the page is generally more "important" than content at the bottom of the page. I wouldn't put my social media links at the top of the page at all because that content shouldn't be indexed before content about my products and services. Many times I want something that isn't as "important," SEO wise, at the top of the page, so I will place it physically in the bottom of the layout.master but positioned absolutely so it will be displayed at the top of the page. This isn't a 100% sure thing though, sometimes you may want the social stuff at the top, just not usually. Hope that makes sense.

HTH,
Joe D.

10/20/2011 12:21:09 PM
Gravatar
Total Posts 383
Thanks Squire Dude

Re: Adding a Google PlusOne-Button

Hi Joe D,

Got it.  Thanks for the pointer.  With that one small peace of information I was able to insert the twitter and Facebook links.

But when I inserted the code for the PlusOne button it all got out of alignment.  I tried adding align="middle" but it didn't do anything.  Can you please help me get the links all on one line?

---------------------------------------------------------------------------------
Code I inserted...

<div id="fb-root">
<!-- Place this tag where you want the +1 button to render -->
<g:plusone annotation="inline"></g:plusone>
<!-- Place this render call where appropriate -->
<script type="text/javascript">
(function () {
var po = document.createElement('script');
po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</div>
<script>(function (d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) { return; }
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
} (document, 'script', 'facebook-jssdk'));</script>
<a class="fb-like" data-href="www.yachtLogSoftware.com" data-send="true" data-width="450" data-show-faces="true"></a>

<strong><a class="twitter-share-button" data-count="vertical" data-via="SquireDude" href="http://twitter.com/share">Tweet</a>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></strong>
<strong><a href="http://www.twitter.com/SquireDude"><img alt="Follow SquireDude on Twitter" src="http://twitter-badges.s3.amazonaws.com/follow_me-a.png" /></a></strong>

<hr />

-------------------------------------------------------------------------------------------------

If you look at my home page you will see what I mean... www.YchtLogSoftware.com

Thanks

10/20/2011 12:44:46 PM
Gravatar
Total Posts 2239

Re: Adding a Google PlusOne-Button

Try this:

<div id="fb-root">
<!-- Place this tag where you want the +1 button to render -->
<g:plusone annotation="inline"></g:plusone>
<!-- Place this render call where appropriate -->
<script type="text/javascript">
(function () {
var po = document.createElement('script');
po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>

<script>(function (d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) { return; }
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
} (document, 'script', 'facebook-jssdk'));</script>
<a class="fb-like" data-href="www.yachtLogSoftware.com" data-send="true" data-width="450" data-show-faces="true"></a>

<strong><a class="twitter-share-button" data-count="vertical" data-via="SquireDude" href="http://twitter.com/share">Tweet</a>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></strong>
<strong><a href="http://www.twitter.com/SquireDude"><img alt="Follow SquireDude on Twitter" src="http://twitter-badges.s3.amazonaws.com/follow_me-a.png" /></a></strong>
</div>

Also, unless you are SquireDude, you may want to change the Twitter links.

10/20/2011 1:32:53 PM
Gravatar
Total Posts 383
Thanks Squire Dude

Re: Adding a Google PlusOne-Button

Hi Joe D,

I don't know what to say... but this time it didn't change anything that I cold see???  Looks the same as it did before.

10/21/2011 10:29:53 AM
Gravatar
Total Posts 383
Thanks Squire Dude

Re: Adding a Google PlusOne-Button

Good morning guys,

Well after some writing and re-writing I have all the Social Bookmarks in place at the bottom of the Layout Master page.  I still have a minor alignment issue.  The icons are all on the same line in the footer but are slightly up or down from each other.

Code to insert into Layout.Master file immediately after <div class="art-footer-text"> (you will have to change web site addresses and mail addresses where necessary)

<div id="fb-root"></div>
<script>    (function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) { return; }
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
} (document, 'script', 'facebook-jssdk'));</script>
<a class="fb-like" data-send="true" data-width="250" data-show-faces="false"></a>

<script type="text/javascript">
(function () {
var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0];
s.type = 'text/javascript';
s.async = true;
s.src = 'http://widgets.digg.com/buttons.js';
s1.parentNode.insertBefore(s, s1);
})();
</script>
<!-- Compact Button -->
<a class="DiggThisButton DiggCompact"></a>

<!-- Place this tag where you want the +1 button to render -->
<g:plusone size="medium"></g:plusone>

<!-- Place this render call where appropriate -->
<script type="text/javascript">
(function () {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();</script>

<a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="SquireDude" data-related="YachtLog">Tweet</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>

<script src="http://platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share" data-counter="right" data-url="http://www.YachtLogSoftware.com"></script>

<img src="http://www.delicious.com/static/img/delicious.small.gif" height="10" width="10" alt="Delicious" />
<a href="http://www.delicious.com/save" onclick="window.open('http://www.delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=550,height=550'); return false;">Delicious Bookmark</a>

<hr />

 

Hope this helps others...

Thanks

You must sign in to post in the forums. This thread is closed to new posts.