I'm using addtoany with display suite and zen theme. I've gotten addtoany button to display as through the custom block field, but the button only links to the site, not using a dropdown. What am I doing wrong here? PS- checked page.tpl.php and I've got the closure tag.

CommentFileSizeAuthor
#3 addtoany_6.x-3.4_cbd_2011-03-22.patch14.95 KBsdsheridan

Comments

micropat’s picture

Status: Active » Closed (fixed)

The latest release, version 6.x-3.4 or 7.x-3.1, works around a lot of these types of issues by hardening the asynchronous loading of AddToAny's external script. Please report back if/when you get a chance.

sdsheridan’s picture

I've been getting a javascript error that da2a is not defined. This happens when the button is rendered, and da2a.script_load(); is called. Now, the catch here is that I've been doing a fair bit of work to optimise websites, including moving the print $scrpts; statement to the bottom on page.tpl.php to speed the loading of the page, letting the JavaScript sort itself out after the page has actually appeared in the user's browser.

AddToAny clearly needs the JS in function _addtoany_header_script to appear before the button's JS, and I suspect that if that's the case and one needs to ensure that's so, then assuming every theme is going to have all the JS printed in the header is perhaps dangerous. Wouldn't it make more sense to have the 'header script' printed the same way as the button script given you want to assure it appears first? Just prepend it to the <a...>tag like the other JS is appended for the first button. I modified the module to do this (6.x-3.4), and my JS error is gone. :-)

Shawn

sdsheridan’s picture

StatusFileSize
new14.95 KB

Attached patch for the above, as well as including functionality for AddToAny on user profile pages.

Shawn