Problems with module diggthis

Lobster - December 21, 2007 - 22:05

I have a problem with the diggthis module, I have installed it and configured to show the icon only on 'story' nodes. It works almost everywhere except on this page:

http://max.duestrade.it/terzaPagina/max/VMGentoo.html

I think there are some characters in the page that puzzle the "digg" system.

(if you want to see a page where it works properly click here: http://max.duestrade.it/CMS-review.html)

Any solution/workaround?

This is how I have configured it:

Button skin:standard
Button skin:#fefcf1
Weight:-20 (but I have the same problem with 20)
Node Types:story

Bye,
Lobster

Sorry, it's always me, just

Lobster - December 22, 2007 - 14:49

Sorry, it's always me, just to give you some more information.

It seems there is a problem with putting an http link in the "digg_bodytext" variable. This way doesn't work

<div class="diggthis_button"><script type="text/javascript">
digg_url = 'http://max.duestrade.it/terzaPagina/max/VMGentoo.html';
digg_title = "Installing a Gentoo Linux system in a virtual machine";
digg_bodytext = "I\'ve got a Fujitsu Siemens AMILO laptop. It\'s a \"family\" computer (i.e. a computer used by all the family) and  up a virtual machine and installing my favourite Linux distribution: Gentoo (http://www.gentoo.org)";
digg_bgcolor = '#fefcf1';
digg_skin = 'standard';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div>

while this way works (I've removed the http link to 'gentoo.org'):

<div class="diggthis_button"><script type="text/javascript">
digg_url = 'http://max.duestrade.it/terzaPagina/max/VMGentoo.html';
digg_title = "Installing a Gentoo Linux system in a virtual machine";
digg_bodytext = "I\'ve got a Fujitsu Siemens AMILO laptop. It\'s a \"family\" computer (i.e. a computer used by all the family) and  up a virtual machine and installing my favourite Linux distribution: Gentoo ()";
digg_bgcolor = '#fefcf1';
digg_skin = 'standard';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div>

Any suggestion? (obviously I could get rid of the link, but this means I can't put any http link in pages were I want to have the digg icon)

Bye,
Lobster

I've found a workaround. I'm

Lobster - December 22, 2007 - 22:26

I've found a couple of workarounds. I'm writing here in case someone will have the same problem in the future. Anyway, I'd be glad to have comments on this.

By inspecting the source code I realised diggthis put in the "digg_bodytext" variable the content teaser.

As I don't like to have trimmed version of articles, I configured my Drupal site with "Length of trimmed posts:" set to "unlimited".

The diggthis module, in this situation, puts all the article in the "digg_bodytext" variable: the teaser, in this case, coincides with the whole text body.

First solution:
The best solution is installing the Drupal module "excerpt" which let's the author write a teaser for each page/story. This way the diggthis module can use the teaser written by the author and not the one automatically extracted from the text body. If the author write a teaser without any http link in it, diggthis works as expected.

Second solution:
By using the "<!--break-->" command as the first line of an article I can force diggthis to leave the "digg_bodytext" variable empty:

digg_bodytext = "";

This way there are no bothering HTTP links. On the site side there is nothing bad, in my case, as I don't use articles trimming, so the "<!--break-->" on the first line of the article doesn't hurt.

If you want to check the result: http://max.duestrade.it/terzaPagina/max/VMGentoo.html

Bye,
Lobster

If you don't want to change every single node entry:

Manamarak - April 29, 2008 - 09:35

You can also achieve this across the site by adding

<!--break-->

in the diggthis.module file

after

<span style="color:grey; font-size:60%; text-align:right">Please help us by digging this page:</span> <script type="text/javascript">
digg_url = '$url';
digg_title = $title;
digg_bodytext = $teaser;
$bg_string
digg_skin = '$skin';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
EOF;

  return '<div class="diggthis_button">'. $digg_js .'</div>';

So that your last line will look like this:

return '<div class="diggthis_button">'. $digg_js .'</div><!--break-->';

 
 

Drupal is a registered trademark of Dries Buytaert.