Adding Tweet Buttons to a FunnelWeb Post

Introduction

I’ve been asked several times how I added the Tweet Button below to all of my FunnelWeb post. Here is a quick blog post detailing how I did it.

image

Let’s do it.

1) Head over to Twiter.com and select the button that you want.

2) You will notice that it generates the following JS/HTML for you.

image

Please note the line numbers listed above.

3) Copy #1 into your HTML Head section on your FunnelWeb Blog site.

image

4) Copy #2 into your \Views\Wiki\Page.cshtml into the appendHTML variable defined below (be sure to escape the quotes if you use this method):

@model FunnelWeb.Web.Views.Wiki.PageModel
@{
  ViewBag.Title = Model.Entry.MetaTitle;
}

<div class='entry @String.Join(" ", Html.CssKeywordsFor(Model.Entry))'>
@{string appendHTML =  "<a href=\"https://twitter.com/share\" class=\"twitter-share-button\" data-count=\"horizontal\" data-via=\"mbcrump\">Tweet</a><a href=\"https://twitter.com/mbcrump\" class=\"twitter-follow-button\" data-show-count=\"false\" data-lang=\"en\">Follow mbcrump</a>";}
  @Html.RenderTrusted(Model.Entry.Body + appendHTML, Model.Entry.Format)
</div>

5) Upload the Page.cshtml to your web server and your ready to go!

Conclusion

Easy enough right? You can of course append any HTML to your Page this way. Google Plus, Linked In Share buttons anyone? 



Posted by: Michael Crump
Last revised: 14 Dec, 2011 03:59 AM

Comments

02 Jan, 2012 06:29 AM

Today, the Microsoft Office 2010 United States began path, in Microsoft Outlook 2010 another way to research robots. The United States DARPA defense advanced research projects agency in Office 2010 Michigan university opened a research group,

xcmortas
xcmortas
11 Jan, 2012 07:12 PM

1rQ u mBD PBqT
x M
www.xrumer.biz

fvmortFl
fvmortFl
12 Jan, 2012 11:10 PM

Lxn o DVP GqYq
O 3
http://xrumer.biz

26 Feb, 2012 05:34 PM

Thank you so much for this post.I found lots of interesting information here. And thanks for sharing it's really wonderful and useful =)))

Opera Mini CoeLp
Opera Mini CoeLp
07 Mar, 2012 08:11 PM

скачать мини оперу на телефон http://operamini-ru.net/ - опера мини для самсунга

No new comments are allowed on this post.

Hosting provided by http://www.DiscountASP.NET