This site:

http://www.hillsdale-econ.com

has the AddThis button enabled on both Node Pages and Node Teasers but it only appears on Pages, not Blog entries. Both authenticateed and anonymous users have permissions to view the AddThis button, only authenticated users can administer it.

It was working, but only the top blog entry would correctly send the title and page link to the AddThis button--after that the button only pointed you to the domain.

Where the button does appear on the page, it is working correctly.

Thanks!

Comments

Jeff Ross’s picture

As I've attempted to debug this myself, I added the following code bock to the addthis_link function:

syslog(LOG_WARNING,"$" . "type = " . $type);
syslog(LOG_WARNING,"$" . "user_access for view addthis = " . user_access('view addthis'));
syslog(LOG_WARNING,"$" . "teaser = " . $teaser);
$node_des = print_r($node,'t');
syslog(LOG_WARNING,"$" . "node = " . $node_des);
syslog(LOG_WARNING,"$" . "addthis node type = " . variable_get('addthis_nodetype_' . $node->type, 1));
syslog(LOG_WARNING,"$" . "add this display in teaser = " . variable_get('addthis_display_in_teasers', '0'));
syslog(LOG_WARNING,"$" . "add this display in links = " . variable_get('addthis_display_in_links', '0'));

Here is the output from syslog when I load the blog page:

2010-01-20 19:48:32.102999500 local7.warn: Jan 20 19:48:32 drupal: $type = node
2010-01-20 19:48:32.103879500 local7.warn: Jan 20 19:48:32 drupal: $user_access for view addthis = 1
2010-01-20 19:48:32.104604500 local7.warn: Jan 20 19:48:32 drupal: $teaser = 1
2010-01-20 19:48:32.106044500 local7.warn: Jan 20 19:48:32 drupal: $node = stdClass Object
2010-01-20 19:48:32.106051500 (
2010-01-20 19:48:32.106055500 [nid] => 15
2010-01-20 19:48:32.106058500 [type] => blog
2010-01-20 19:48:32.106062500 [language] => en
2010-01-20 19:48:32.106066500 [uid] => 5
2010-01-20 19:48:32.106070500 [status] => 1
2010-01-20 19:48:32.106078500 [created] => 1263965888
2010-01-20 19:48:32.106084500 [changed] => 1263966202
2010-01-20 19:48:32.106088500 [comment] => 2
2010-01-20 19:48:32.106092500 [promote] => 1
2010-01-20 19:48:32.106888500 [moderate] => 0
2010-01-20 19:48:32.106892500 [sticky] => 0
2010-01-20 19:48:32.106896500 [tnid] => 0
2010-01-20 19:48:32.106900500 [translate] => 0
2010-01-20 19:48:32.106904500 [vid] => 15
2010-01-20 19:48:32.106908500 [revision_uid] => 5
2010-01-20 19:48:32.106912500 [title] => And now the good news...
2010-01-20 19:48:32.106916500 [body] =>

As I was completing the previous post, two interesting news items flashed on my screen.  The first is the decisive victory of Republican Scott Brown in the race for the Senate seat previously held by Ted Kennedy.  The second is the deal President Obama has forged to establish a budget commission to develop a plan to begin reducing deficits.  (The link to the article requires registration with Washington Post, free of charge.)  

 

2010-01-20 19:48:32.107038500
2010-01-20 19:48:32.107042500

Brown's victor...
2010-01-20 19:48:32.108629500 local7.warn: Jan 20 19:48:32 drupal: $addthis node type = 0
2010-01-20 19:48:32.109436500 local7.warn: Jan 20 19:48:32 drupal: $add this display in teaser = 1
2010-01-20 19:48:32.110239500 local7.warn: Jan 20 19:48:32 drupal: $add this display in links = 1

And here is the same output where a page is loaded and the AddThis button appears:

2010-01-20 19:51:22.133982500 user.warn: Jan 20 19:51:22 roundcube: $type = node
2010-01-20 19:51:22.134868500 user.warn: Jan 20 19:51:22 roundcube: $user_access for view addthis = 1
2010-01-20 19:51:22.135577500 user.warn: Jan 20 19:51:22 roundcube: $teaser =
2010-01-20 19:51:22.137039500 user.warn: Jan 20 19:51:22 roundcube: $node = stdClass Object
2010-01-20 19:51:22.137046500 (
2010-01-20 19:51:22.137050500 [nid] => 2
2010-01-20 19:51:22.137054500 [type] => page
2010-01-20 19:51:22.137058500 [language] => en
2010-01-20 19:51:22.137062500 [uid] => 1
2010-01-20 19:51:22.137066500 [status] => 1
2010-01-20 19:51:22.137069500 [created] => 1259007854
2010-01-20 19:51:22.137073500 [changed] => 1259423138
2010-01-20 19:51:22.137078500 [comment] => 0
2010-01-20 19:51:22.137081500 [promote] => 0
2010-01-20 19:51:22.137951500 [moderate] => 0
2010-01-20 19:51:22.137956500 [sticky] => 0
2010-01-20 19:51:22.137960500 [tnid] => 0
2010-01-20 19:51:22.137964500 [translate] => 0
2010-01-20 19:51:22.137968500 [vid] => 2
2010-01-20 19:51:22.137972500 [revision_uid] => 5
2010-01-20 19:51:22.137975500 [title] => Charles N. Steele
2010-01-20 19:51:22.137980500 [body] =>

Only local images are allowed.Charles N. Steele is the Herman and Suzanne Dettwiler Chair in Economics and assistant professor at Hillsdale College in Hillsdale, Michigan. His publications include papers on the Soviet economy and economics of transition, economic growth, and institutional change.  He received his Ph.D. in economics from New York University in 1997, and has subsequently taught economics at the graduate and undergraduate levels in the People’s Republic of China (China Agricultural Universi...
2010-01-20 19:51:22.139422500 user.warn: Jan 20 19:51:22 roundcube: $addthis node type = 1
2010-01-20 19:51:22.140140500 user.warn: Jan 20 19:51:22 roundcube: $add this display in teaser = 1
2010-01-20 19:51:22.140939500 user.warn: Jan 20 19:51:22 roundcube: $add this display in links = 1

I can see the difference between the two but I'm relatively new to drupal so I'm yet at a loss as to *why* there's a difference, or more, how I can fix the problem.

Thanks,

Jeff Ross

Jeff Ross’s picture

I did all the debugging I knew how and made no headway so I switched to AddtoAny which is working as I'd expect it.

babbage’s picture

I wonder—did you do custom theming of the blog pages? It appears that if you custom theme a page with a node-nodetype.tpl.php file, AddThis does not appear automatically even if turned on for that content type. Obviously being appended to the node content in a way that does not survive field-by-field theming...

babbage’s picture

For anyone else having this kind of issue, it's likely because AddThis is output in the $links and if you've created a custom by-field template for your node, you're not including the links. Here's the basic code to put them back—the surrounding DIV is of course optional, but just gives you the default links styling...

<?php print '<div class="links-container">'; ?>
<?php print $links; ?>
<?php print '</div>'; ?>
babbage’s picture

Title: AddThis button no longer appears in any blog entries » AddThis button does not appear if links are excluded in node.tpl.php through theme

Better title for others to find this.

babbage’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.