digg this not showing correctly
adjustreality - March 24, 2009 - 23:08
can't seem to get "digg this" module to show up on views pages under each post, only on individual nodes. any ideas?
can't seem to get "digg this" module to show up on views pages under each post, only on individual nodes. any ideas?
found a solution that kind of
found a solution that kind of works not exactly what I wanted but it works. service links works similar to this and has a dig option though it doesn't allow for dig amounts. I'm going to add a code snippet to fix this eventually...
It appears to be "by design".
It appears to be "by design". See this issue: 160617: DiggThis ('Digg this' developer says "Load times are too long...")
You can probably do it relatively easily by modifying the node.tpl.php (or node-story.tpl.php, etc) file in your theme to include it on teasers, or possibly by using the Contemplate module.
If by "views pages" you mean you're using the Views module, it may be a little trickier, or it still may be just a matter of theming but specifically for Views.
In any of those cases, it would take a little bit of php code to make it function properly, but I wouldn't expect it to be too much. I would look at the
diggthis_button_create()function to get started on that code.Want to thank me? Here's my Amazon wishlist.
I decided to see what it
I decided to see what it would take to do it, and at first it appeared that it could be done with just a few lines added to the node.tpl.php file, but Digg's javascript overrides the javascript set in the page after it loads, and all of the Digg buttons are for the entire page you're viewing, rather than for each node/teaser.
Want to thank me? Here's my Amazon wishlist.
It appears to work properly
It appears to work properly if you paste this into your node.tpl.php file (or a variation of that file name) where you want the 'Digg this' tool to show up in your teaser. (replace "DOMAIN_NAME" with the actual domain name w/out the slash)
<?php if ($teaser): ?><iframe src="http://digg.com/tools/diggthis.php?u=http://DOMAIN_NAME<?php print $node_url ?>&s=standard&t=<?php print $title ?>" height="80" width="52" frameborder="0" scrolling="no"></iframe>
<?php endif;?>
It looks like the main thing the Digg javascript file is doing is generating an iframe tag like this. By bypassing Digg's javascript, you might increase the risk of things breaking more suddenly in the future, however. But their javascript is designed with the assumption that there's only one Digg this button on the page. You can find more info about the various parameters you can pass in the url, as well as some potential limitations (length of parameters, such as the title) here.
Want to thank me? Here's my Amazon wishlist.
ahh, makes sense. I'll do
ahh, makes sense. I'll do some more reading, thanks!