This apparently started recently after I did some updates, and I’m not sure what module is actually causing it.

At http://advocarev100bowl.org/ there is a Nivo Slider View on the home page. Clicking the title or body text displayed in the overlayed caption box works fine. But, clicking the image itself (which you can see in the URL if you hover over it) does only a relative path (e.g. “/release/…” instead of “http://advocarev100bowl.org/release/…”). Yet, the link tags are rendering with “target="blank:” added, so that it tries to open that in a new window, and of course it fails and makes us look really incompetent.

I went into the View and made sure that the Image field was set to link to Nothing, I also checked all settings in the Views Nivo Slider dialogs for both “Format” and “Show” and found no options that would affect this.

I’d rather it not render the image as a link at all than have it attempt to go to a relative URL in a new tab and thus blow up!

Comments

Joel MMCC’s picture

Issue summary: View changes
Joel MMCC’s picture

Issue summary: View changes
Joel MMCC’s picture

Update: I set the “Link field” to “<None>” in the Show (not Format) Settings, and that at least keeps users from clicking on a bad link. I used Rewrite Field on my Title field to have the caption text link properly.

The underlying problem remains: the link specified in the “Link field” currently adds “target="_blank"” to the generated “<a class="nivoLink" href="…" …>” tag surrounding the <img class="nivo-main-image" src="…" …>” tag. This forces the link to open in a new tab, and if it’s a relative link as would be the case if linked to a “Content: Link” field to link to the content node page (a very common usage scenario), it will fail.

Proposed Solution:

Add an “Open in New Tab?” checkbox either to the right of or just below the “Link field” in the Show Settings dialog. If and only if that’s checked, add the “target="_blank" and also prepend any relative links with the site base URL so that even they would properly work.

Joel MMCC’s picture

Priority: Normal » Major
podarok’s picture

Category: Bug report » Feature request
Priority: Major » Normal

Feel free to upload patch for fixing it
Not sure this is a bug so changing as feature request

VARONI’s picture

I used into my image field, in the REWRITE RESULTS->Text, the following: <a href="[path]" target="_blank"><img src="[field_XXX]" class="img-responsive"></a> and it worked. When click on the image the view page is loaded in a new window.

Joel MMCC’s picture

I know it’s been years, but I just saw this while looking for something else.

We no longer maintain that site so the links I gave in the description no longer work. It was redone in non-Drupal entirely, and since the Independence Bowl has a new sponsor other than AdvoCare, I think the URL itself may be defunct.

That said, how is this not a bug? And a major one at that? What possible reason would there be to have a relative link open in a new tab? It can’t possibly work!