by MGD King
November 16, 2010
With the popularity of Facebook reaching new heights everyday, I thought that it would be cool to have a “Share to Facebook” link at the bottom of all of my posts so if anyone ever wanted to share anything they could. I searched on the DotNetBlogEngine discussion boards and couldn’t find much to help me. However, there was one post that pointed me in the right direction, and now I’ve figured out how to add the link to all of my posts! Here’s all you have to do:
In your current theme folder, open the PostView.ascx file, and place the following code into <div class="bookmarks"> section:
<a rel="nofollow" href="http://www.facebook.com/sharer.php?u=<%=Server.UrlEncode(Post.AbsoluteLink.ToString()) %>" target="blank"><img src="<%=VirtualPathUtility.ToAbsolute("~/pics/")%>f_logo.png" alt="Share on Facebook" style="margin-right:3px" />Share on Facebook</a>
If you want to use a logo, just make sure it's named f_logo.png and you place it in your PICS folder. If you do not want to use a logo, remove the <img src="<%=VirtualPathUtility.ToAbsolute("~/pics/")%>f_logo.png" alt="Share on Facebook" style="margin-right:3px" /> line from the above text.
Save the file on your server or hosted platform and then go to your blog’s homepage. Now you will see the link at the bottom of posts that links individual posts to Facebook!
Latest Comments
- How To Delete Thumbs.db in Windows 7 (13)
- How To Reinitialize The Offline Cache in Windows 7 (12)
- How To Reinitialize The Offline Cache in Windows 7 (12)
Comment RSSOdell Huffman wrote: thx your the sh!t [More]
MGD King wrote: I'm wondering if the file syncing issue has mo... [More]
Jason wrote: I just tried with a different laptop and it did no... [More]