BlogEngine.Net: +1 (plusone) Button

There has been a lot of discussion lately about Google’s +1 service. Google has even made it easy to add a +1 button to your webpage.

It is just as easy to add a +1 button to your BlogEngine.Net posts.

First need to add the following script to the HEAD section of your site.master template.

 

<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>

 

Then you only need to add the following to your PostView.ascx file where you would like the button to be displayed:

 

<g:plusone size="small" count="false" href="<%=Post.PermaLink %>"></g:plusone>

To display the +1 count for the post change the count attribute to true.

 

You can see more +1 button options here.



   

BlogEngine.net: StumbleUpon Button

In a previous post I discussed how to display Twitter, Facebook and dotNetKicks buttons in a BlogEngine.Net.  It is also possible to add ad StumbleUpon botton to you BlogEngine.Net post.

Place the following code in your PostView.ascx page.

<script src="http://www.stumbleupon.com/hostedbadge.php?s=2&r=<%=Post.PermaLink %>"></script>

The "s" parameter can be changed to a number 1-6 to displacy additional button types.



   

BlogEngine.net: Twitter, FaceBook and DotNetKicks Buttons

Outside of setting up an extension you can easily add Twitter, FaceBook and DotNetKicks buttons to you BlogEngine.Net posts by inserting the following code snippets in the desired location of your theme’s PostView.ascx page:

Twitter:

<a href='http://twitter.com/share' class='twitter-share-button' data-url='<%=Post.PermaLink %>'
                data-count='horizontal'>Tweet</a><script type='text/javascript' src='http://platform.twitter.com/widgets.js'></script>

 

FaceBook:

<iframe src='http://www.facebook.com/plugins/like.php?href=<%=Post.PermaLink %>&layout=button_count&show_faces=false&action=Like&colorscheme=light'
                frameborder="0" scrolling="no" style="border-style: none; height: 20px; width: 90px;
                overflow: hidden;"></iframe>

Note:

  • The options for layout are button_count, standard and box_count 
  • The options for action are like and recommend 
  • The options for colorscheme are light and dark

 

DotNetKicks:

<a href="http://www.dotnetkicks.com/kick/?url=<%=Post.PermaLink %>&title=<%=Post.Title %>"
                target="_blank">
                <img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=<%=Post.PermaLink %>"
                    border="0" alt="kick it on DotNetKicks.com" /></a>