• Home
  • About
  • Portfolio
  • Contact
  • PostsComments

Coding Still

Baby debugging steps...

  • .NET Development
  • Asp.net
  • Fun
  • IIS
  • Javascript
  • Web Design
You are here: Home / Web Design / Tips for sharing your site

Tips for sharing your site

December 7, 2010 By _tasos Leave a Comment

If you want to make a social bar for your site, I would recommend the addthis sharing platform. It is very easy to use and has many options so that you can have a personalized social bar. In most cases, you would like 2 or 3 sharing buttons (e.g. facebook, twitter), an email and a print button.

Let’s say that you want to make a social bar that has a facebook icon, a twitter icon, a more icon (that allows you to share your page sith all the 313 services that addthis supports), a print and an email icon. You could use icons from addthis, or (better) use your own. To use addthis you simply call its js script (you can get it from the addthis website) and then simply add a class to your link or image. For example:

<a class="addthis_button_facebook">
    <img src="/images/gt/fb.png" alt="" title="Send to Facebook " />
</a>

For every service there is a class that you could use and utilize this functionality. It is that simple. Addthis has a rich Client API and the new Analytics API which provides statistics for your pages and their “sharing” activity.

After you created your social bar, you want to make some changes in your page meta, so that when a visitor shares your page with facebook you can control the title, description and thumb url properties that facebook uses when a page is shared. Facebook requires that you add three (at least) meta tags to define these properties for your page. You can read about it in detail here but the three basic meta are:

<meta property="og:title" content="CodingStill blog" />
<meta property="og:description" content="CodingStill is an awesome blog!" />
<meta property="og:image" content="http://codingstill.com/fb_share.jpg" />

One thing that you need to know is that facebook has some restriction about the image dimensions. The thumbnail’s width AND height must be at least 50 pixels, and cannot exceed 130×110 pixels. The ratio of both height divided by width and width divided by height (w/h, h/w) cannot exceed 3.0. These restrictions aren’t applied every time but it is good to follow them.

One important thing to keep in mind is that the sharing service of facebook has a caching mechanism so if you’re trying to debug your site with these meta properties you probably view your cached version of your page. To avoid caching you can use the URL Linter, a page where you can test your page and see its properties with no caching applied here. Your page will remain cached for a few days (maybe a week). If you really want to reset the cache you have to change the URL of your page. But this action might not be good since the original URL is already been shared, liked, etc.

Other sharing services use the more common meta, such as meta description and meta keys. If you put in these tags an id and a runat=”server” attribute you get  System.Web.UI.HtmlControls.HtmlMeta objects and can control them in code behind and set the content property via code. But there is a catch here, if the string value you set in the content property has the new line character or (worse) the ” character, asp.net will not handle these characters differently but will just put then in your markup and ruin it. So, you have to take care of that by your self and handle (a.k.a. remove) those characters.

Filed Under: Web Design Tagged With: SEO, social media

Speak Your Mind Cancel reply

*

*

CAPTCHA Image
Refresh Image

*

Popular Posts

image-resize

Creating thumbnails from JPG images with .NET

The .NET framework has the System.Drawing namespace which allows the developer to create and/or …
[Read More...]

asp-net-ajax

ASP.NET and Ajax. All about update panels, web methods, page methods and jQuery

In modern web applications is expected that the implementation is more JavaScript based, so that its …
[Read More...]

handle_errors

Handling server errors in asp.net

When we have a web application in production, there are times where some things go wrong and we have …
[Read More...]

antlr_logo

AntLR And Visual Studio

Here is a simple tutorial in which there the instructions you need in order to begin working with …
[Read More...]

jSmooth

jSmooth – A jQuery plugin

jSmooth is a jQuery plugin which allows you to have a smooth scrolling effect when you are in the …
[Read More...]

delegates

Using generics to override static methods

I am currently working on a library that will be used in my company's new and biggest project. This …
[Read More...]

iis7

Url rewriting in IIS7

Url rewriting was a weak point for IIS. While Apache Web Server had the mod_rewrite module, for IIS …
[Read More...]

db_backup

Backup the data from your Sql Server

An often requirement in a CMS is the user to be able to backup the database of its CMS installation. …
[Read More...]

export_excel

Export data to excel for non-latin characters

A common feature in applications is to export data in excel. With .NET it is pretty simple with the …
[Read More...]

redirecting

Handling redirections, missing pages and server errors in asp.net

In a CMS application it is really common for each authors to add, move and delete pages. In a busy …
[Read More...]

Return to top of page

Powered by Wordpress. Hosted by Rackspace Cloud