Currently, the Spotlight widget will turn the "Title" into a link if a value is provided. Several users have requested that the image itself should also link to the given URL. I think this probably makes sense!

Comments

miromarchi’s picture

I add "ability to link images placed with image widget" as a related issue, since it is the same feature request but referred to image widget.

mglaman’s picture

Status: Active » Needs review
StatusFileSize
new940 bytes

Patch to wrap image in a link, if link provided.

electroponix’s picture

I tried applying this patch to the latest "stable/non dev" version and it broke the site.
Is there a patch for the most recent version?

mglaman’s picture

StatusFileSize
new939 bytes

Wow, fail on my part, sorry. There was a missing semicolon :/. Can you try this patch?

electroponix’s picture

Still breaking the site. Get the white screen and have to revert it for it to work again.

electroponix’s picture

I am on 7.1.11 Should I go to the dev version?

mglaman’s picture

Status: Needs review » Needs work

electroponix can you check what the exact error is? Sorry I just quick-re-rolled patch for obvious error - didn't have error when first wrote patch (obviously goofed patch somehow, though.)

mglaman’s picture

Status: Needs work » Needs review
StatusFileSize
new936 bytes

Fixed up. I somehow patched/used the D6 syntax for l()? It's all correct now.

electroponix’s picture

Thanks! Will try again. Sorry I didn't get bak on this sooner, lots of things in the cooker.

electroponix’s picture

It worked. Thanks again. My designer is a happier camper. :)

mglaman’s picture

Awesome! If it worked could you mark this issue as "Reviewed & Tested by the Community"? That way maintainers know it's a good to go fix!

electroponix’s picture

Status: Needs review » Reviewed & tested by the community

The last patch works. One other suggestion is a toggle button on the spotlight to turn off the text link altogether.

dsnopek’s picture

One other suggestion is a toggle button on the spotlight to turn off the text link altogether.

@electroponix: That's an interesting idea, thanks!

However, rather than adding more options to Spotlight, I'd like to suggest an alternative approach: currently, we're building the HTML for Spotlight widgets entirely in code in the hook_field_formatter_view(). Let's move that to a theme function with a template, so that it'd be easy for themers to override and change how the spotlight is rendered. I've created a new issue for it: #2334041: Move rendering of Spotlight formatter into theme function

dsnopek’s picture

Status: Reviewed & tested by the community » Fixed

Committed!

  • dsnopek committed 78188cc on 7.x-1.x
    Issue #2274877 by mglaman | dsnopek: Added Spotlight image should link...

Status: Fixed » Closed (fixed)

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