I wanted extlink to operate on image links as well. Currently, the javascript that processes links specifically excludes them (probably to avoid putting little icons after the images, which would be weird).

But we're not using the icons, instead, extlink_extra provides a colorbox option, and for that to work the image links need the "ext" class applied.

This patch adds a variable, extlink_class_img which defaults to FALSE (so no change in behavior. If you set it to TRUE in your settings.php file however, it should catch imagelinks as well. It's a little rough (I didnt add it to the admin screen, variable not removed on uninstall) but if there's interest I will improve it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rj’s picture

+1 for this.

New patch attached that includes a checkbox on the admin screen to enable/disable.

elachlan’s picture

Title: Apply class to image links too » Add option to add icon to image links
Version: 7.x-1.12 » 7.x-1.13
Assigned: kscheirer » Unassigned
Status: Needs review » Needs work

As we have extlink_mailto_class as a variable I would like to follow the naming convention and make the variable extlink_img_class.

Also the administration menu item should appear below the mailto. We should treat it as a separate option.

elachlan’s picture

Version: 7.x-1.13 » 7.x-1.x-dev

If you re-roll the patch I will see about it's inclusion.

rj’s picture

Status: Needs work » Needs review
FileSize
2.36 KB

See attached.

Status: Needs review » Needs work

The last submitted patch, extlink_apply_to_images-1857612-4.patch, failed testing.

rj’s picture

Status: Needs work » Needs review
FileSize
2.43 KB

This should be better.

Status: Needs review » Needs work

The last submitted patch, extlink_apply_to_images-1857612-6.patch, failed testing.

elachlan’s picture

Tests are failing at the moment. I am currently fixing it. Sorry!

rj’s picture

Yeah I saw it was coming from extlink.test, let me know when I should resubmit.

elachlan’s picture

Status: Needs work » Needs review
elachlan’s picture

Status: Needs review » Needs work

I might get you to re-roll once the changes in Issues #1329786: JS refactoring are completed.

elachlan’s picture

Status: Needs work » Needs review
FileSize
2.35 KB

Re-rolled the patch. Looks like it's working. Let me know what you think.

rj’s picture

Looks good!

elachlan’s picture

Status: Needs review » Patch (to be ported)

Committed to Git.

DamienMcKenna’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Issue summary: View changes

Moving to the correct branch.

elachlan’s picture

I believe the new setting wasn't added to extlink.settings.yml

Its in all other places.

elachlan’s picture

Status: Patch (to be ported) » Fixed

As far as I can tell this was already done.

Status: Fixed » Closed (fixed)

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