Posts Tagged ‘addthis’
Drupal: how to add a “share in facebook” link without IE8 crashing
I am developing a Drupal website and my client wants a “Share in facebook” button to appear in his news.
Well, first time I thought about using addthis but I did not want to depend on addthis.
Then I tried to use the facebook share tool, which they claim to be something simple to use, just these lines:
<a name="fb_share" type="button" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
But then, when using Internet Explorer 8, the page was not rendering ok, and this message was shown:
FB.loader is null or not an object.
http://static.ak.fbcdn.net/connect.php/js/FB.Share
FB.Share line:15
Code:0 Char:1
And Firebug tells me:
FB.Loader is undefined
FB.Share()FB.Share (line 15)
[Break on this error] FB.Loader.onScriptLoaded(["FB.Share","FB.SharePro"]);
The solution to this problem seems to be easy, as explained in this post, it is supposed to work fine by just adding a call to “FB.Loader” function:
But in my case it still did not work properly, so I decided to use another code to genereate a “Facebook share” button:
I edited my node-story.tpl.php, deleted the following lines:
<a name="fb_share" type="box_count" share_url="<?php echo url("node/".$node->nid,array("absolute"=>true)); ?>" href="http://www.facebook.com/sharer.php?t=<?php echo $node->title; ?>">Compartir</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Loader" type="text/javascript"></script><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>And added these ones:
<script>
function fbs_click(){
u=location.href;
t=document.title;
window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
return false;
}
</script>
<style>
html .fb_share_link { padding:2px 0 0 20px; height:16px; background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top left; }
</style>
<a rel="nofollow" href='http://www.facebook.com/share.php?u=<?php echo url("node/".$node->nid,array("absolute"=>true)); ?>' onclick="return fbs_click()" target="_blank" class="fb_share_link">Compartir</a>
<br />Easy and no annoying problems
AddThis plugin for joomla 1.5
I was searching for some plugin to insert addthis button in a project which uses joomla and I was able to find it in informalthinkers.com.
Thanks a lot for this great plugin.
Aumentar el tráfico a tu sitio web: AddThis
Muchos usuarios me preguntan cómo aumentar el tráfico a su sitio web. Para ello, además de tener una página bien construida (DTD’s validados), usar url’s SEF, etc, debemos realizar labores de promoción y fidelización del lector. (Te recomiendo la lectura de mi anterior artículo de mejora de posicionamiento)
Una buen forma de promoción para tu sitio web pasa por ofrecer a tus lectores la posibilidad de añadir tu página a favoritos, o compartir las noticias (digg, twitter, etc). Existe un servicio, llamado addthis.com, que es idóneo para ello.
Cuando colocas el botón de AddThis en tu sitio web, automáticamente determina la URL de tu página. Cuando los visitantes hacen click en este botón, éste les lleva a una página que permite elegir qué servicio de favoritos prefieren utilizar.
Como veréis, utilizo el botón de AddThis a lo largo de toda mi página. Si ofreces contenidos interesantes, existe un enorme mercado de lectores que querrán añadirte a favoritos, y esto generará miles de enlaces a tu sitio web y aumentará de forma considerable tu ranking.
Añadiendo este botón a tu blog WordPress
Puedes añadir AddThis como plugin o como widget.
Como plugin: entra en la sección de plugins – Add new y busca AddThis. Instálalo y actívalo. Fácil, sencillo y para toda la familia
Como widget: entra a AddThis y rellena el formulario para darte de alta. Éste te proporcionará un código fuente, que debes copiar (Control+V). Después accede al panel de administración de WordPress, más en concreto a la sección de Apariencia (Appearance) y pulsa sobre Widgets. Crea un nuevo Widget de texto e inserta el código AddThis, que debería ser algo asi:
<!-- AddThis Button BEGIN --> <div><a href="http://www.addthis.com/bookmark.php?v=250" title="Bookmark and Share" target="_blank"><img src="http://s7.addthis.com/static/btn/lg-bookmark-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div> <!-- AddThis Button END -->
¿Te ha parecido interesante el artículo? Añádenos como favorito!