I see that the module only offers the option to use images for the button itself - but I would love to have both a image and some text for showing the box - i.e. "[Icon] Share this page".
I've been able to alter the link from a template.php by doing this:
function phptemplate_preprocess_node(&$vars) {
foreach ($vars['node']->links as $module => $link) {
if ($module == 'addtoany') {
$vars['node']->links[$module]['title'] .= '<a href="#">Share this page</a>';
}
$vars['links'] = theme('links', $vars['node']->links,array('class' => 'links inline'));
break;
}
}
But that link doesn´t show the box. Can I modify the link to do so, or would it be possible to add text as an option to the module?
Comments
Comment #1
Sidor commentedNo one who can help with this one?
Comment #2
micropat commentedComment #3
ao2 commentedHi, I also wanted this implemented.
The attached patch could be a possible solution to this one.
Note: it should be applied on top of the patch in #634208: Changes to Button image HTML attributes not saved.
Regards,
Antonio
Comment #4
ao2 commentedping
Comment #5
ao2 commentedping
Comment #6
loominade commentedI needed this function too, so I implemented it.
have fun!
Comment #7
ao2 commented@loominade, your attachment is exactly the same of addtoany-6.x-2.4.tar.gz (md5sums match)
Maybe you applied the patch from #3 but attached the wrong archive? Or just trolling? :)
This counts as an "up" as well.
Regards,
Antonio
Comment #8
grasmash commented@ao2
I've attached the modified module. Both patches:
-drupal_addtoany_fix_custom_image_attributes_v1.patch
-drupal_addtoany_add_link_text_v1.patch
have been applied.
Comment #9
ao2 commentedI don't think that attaching patched modules is generally a good idea, we should ping the module maintainer and ask him to integrate the patch and release a new version. The patches are already available for those who want to apply them after all, and this is not a very complex operation.
Just my 2 cents.
Changed the title back to the original.
Regards,
Antonio
Comment #10
dalinI think a better aproach would be to have three separate settings:
- image source
- text
- text placement (before/after image)
This would allow greater flexibility and would allow the use of theme_image() which would offer better browser layout performance (due to image dimensions being included).
Comment #11
mstrelan commentedI don't want an image at all, just text. Do these patches cater for that?
Comment #12
grasmash commentedCan this patch be committed?
Comment #13
micropat commentedHappy birthday to all! 6.x-3.3 supports text alongside the button image, and a text-only button. Finally. :)
Comment #14
grasmash commentedThanks micropat. Lookin good.