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

Sidor’s picture

No one who can help with this one?

micropat’s picture

Assigned: Unassigned » micropat
Status: Active » Needs work
ao2’s picture

Version: 6.x-2.3 » 6.x-2.4
Status: Needs work » Needs review
StatusFileSize
new2.06 KB

Hi, 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

ao2’s picture

ping

ao2’s picture

ping

loominade’s picture

StatusFileSize
new13.84 KB

I needed this function too, so I implemented it.

have fun!

ao2’s picture

@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

grasmash’s picture

Title: Image and text » Modified Module Attached
StatusFileSize
new21.18 KB

@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.

ao2’s picture

Title: Modified Module Attached » Image and text

I 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

dalin’s picture

Status: Needs review » Needs work

I 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).

mstrelan’s picture

I don't want an image at all, just text. Do these patches cater for that?

grasmash’s picture

Can this patch be committed?

micropat’s picture

Assigned: micropat » Unassigned
Status: Needs work » Fixed

Happy birthday to all! 6.x-3.3 supports text alongside the button image, and a text-only button. Finally. :)

grasmash’s picture

Thanks micropat. Lookin good.

Status: Fixed » Closed (fixed)

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