AddThis is a great module but it could be even better if it either came with the ability to add a class and title to the button image or a class and title were hard coded into the .module file, thus Only local images are allowed..

Adding a class to the image would be a big help for CSS positioning. A title (and probably also an alt tag) would increase accessibility.

Comments

Anonymous’s picture

Oops, the code after "... were hard coded into the .module file, thus " was dropped. Should be:

<img src="%s" width="%d" height="%d" %s class="addthisbutton" title="Share this page with AddThis" alt="AddThis icon" />

Everett Zufelt’s picture

Issue tags: +Accessibility
matglas86’s picture

Version: 7.x-2.x-dev » 7.x-4.x-dev

This needs to be added to a basic display type for the compact button. Also with upload functionality for a button. Or a path input box where you can specify the name path of the image (e.a in theme folder).

mjross’s picture

It would be wonderful if a CSS class were added to the <a> tag, or put in a div wrapping the <a> element. As it now stands, it's difficult if not impossible to reposition the image, which on my page is being positioned immediately underneath the first node field, above the subsequent fields -- which doesn't look good.

mjross’s picture

Even though the module does not automatically add a CSS class, I just now noticed that it is possible to add one or more classes (or other attributes) to the img tag using the settings: At admin/config/system/addthis, set "Button image HTML attributes" to something like: class="addthis"

matglas86’s picture

@mjross. I think you are using a old version of the module. Because the admin url you mention is not the url that is used in the 4.x version. It now is at admin/config/user-interface/addthis and you can add extra css classes in the display settings of the field for each view mode of a node type.

Can yo check if what you want can be achieved with the latest version of the module. Keep in mind that there is not a upgrade path so run it on a test site. :)

mjross’s picture

@matglas86: You are correct; I was using an outdated version, 7.x-2.1-beta1, probably because the Updates page did not flag it as out of date, but instead colored it green. Perhaps that is the standard protocol for new versions of modules still in beta.

Just now I updated to 7.x-4.0-alpha1, and it killed the web site. All I get now is the message "Fatal error: Class 'AddThisJson' not found in D:\_x\Drupal_7_dev\sites\all\modules\addthis\classes\AddThis.php on line 84". I searched the issue queue, and did not find any information pertaining to how to solve this problem.

matglas86’s picture

Did you notice my remark

Keep in mind that there is not a upgrade path so run it on a test site. :)

To fix the fatal error look at rebuilding your registry with the module Registry rebuild.

mjross’s picture

Yes, I did see your earlier recommendation to use a test site, and that's what I used. But there was no mention that it could cause a fatal error, nor how to resolve such an error. Thanks for the info.

matglas86’s picture

Status: Active » Needs work

I think how I can fix this error besides using registry rewrite. I think there is a condition where the class is called but not included yet. I have to verify what is the cause of that and fix that. Thanks for letting me know about the error.

matglas86’s picture

Status: Needs work » Fixed

@mjross I did a fix to load the AddThisJson class. This is already committed. I hope it will fix it for you too. I don't know if anything specific was requested further more here. Marked fixed.

Status: Fixed » Closed (fixed)
Issue tags: -Accessibility

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