Home > Tools > CMS > Drupal > Drupal Hacks > Add an Interactive yigg.de Button in Your Theme

Add an Interactive yigg.de Button in Your Theme

yigg.de is a German language social news community that resembles digg.com in many aspects. To add an interactive yigg.de button (also see diggthis), I added the following code in my theme:

in template.php add

function mytheme_yiggbutton($nid) {
$url = url('node/'.$nid, NULL, NULL, TRUE);
$output =<<<EOF
<div class="yiggbutton">
    yigg_url = '$url';
  <script src="http://yigg.de/emb_ycount.js"></script>


in node.tpl.php add

if ($page != 0 && in_array($node->type, array('blog','video','image'))) {

This will display the yigg.de button if the node is a blog, a video or an image.

Live Example

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <br> <img> <h2> <h3> <h4> <h5>

More information about formatting options

Refresh Type the characters you see in this picture.
Type the characters you see in the picture; if you can't read them, submit the form and a new image will be generated. Not case sensitive.  Switch to audio verification.