Problem/Motivation

I find this to be a nice module providing good value at my site. However, I would also like to add a tooltip to the link when the user hovers the link. I guess that should be achievable, but beeing a newbie in Drupal I haven't been able to figure out how to add this by myself.

Steps to reproduce

Proposed resolution

The result could produce a html like this:
<a href="www.google.com" title="this is a link to google">Google tooltip</a>

Other more relevant ways might exist for all I know.

Remaining tasks

User interface changes

I guess that the user might input the value to be shown in the same manner as how the "Link text" is established today with the possibility to use tokens to insert text from any field connected to for instance the media to be linked to.

API changes

Data model changes

Comments

oasweb created an issue. See original summary.

danflanagan8’s picture

Status: Active » Needs review
StatusFileSize
new13.94 KB

Hi oasweb,
Thanks for putting in the nice issue. I think this is a good idea. Here's a patch that adds a new config field to the field formatter where you can specify a title attribute for the link. Tokens are supported so you can go wild with those.

I've added test coverage, but it would be great if you would confirm that the patch works for you before I cut a new release.

oasweb’s picture

Thanks danflanagan8!
This works as a charm, exactly as I had imagined :)
One comment though, if the token returns an empty string, the placeholder is output instead. (Don't know if this is common practice?)

For the more important settings, they appear in a short form at the overview at the "admin display" page. I'm not sure if this one qualifies to be shown as well?

danflanagan8’s picture

Very nice catches! Here's a new patch that clears the tooltip tokens correctly and adds better formatter summary text in the UI. There's a new test for clearing tokens so that this bug never comes back.

oasweb’s picture

Excellent! Then I have had time to test this as well, and I thinks this works very well :) Thank you!

  • danflanagan8 committed 2bed418 on 8.x-1.x
    Issue #3180734 by danflanagan8, oasweb: Add tooltip to the download link
    
danflanagan8’s picture

Status: Needs review » Fixed
danflanagan8’s picture

I just put out a new release with this feature. Thanks for your interest in this module!

Status: Fixed » Closed (fixed)

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