In Views -> Showcase Display Options I tried to set "Link to Anchor," with no effect.

I also tried linking to nodes for the field outputs. In that case hovering over the title pulls up a preview of the link, but actually clicking the tile does not lead to the node.

I want to link to something other than the node, but can set that up using URL alias if necessary.

Any ideas?

Comments

rfsbsb’s picture

Status: Active » Needs review

This is a very old issue, but let me answer it.

Anchor the links will not link to any place, just flip to slide.

To have a link, you must indicate in the view fields a option to link to the content.

lucascaro’s picture

just FYI this doesn't work with views showcase 7.x-1.x-dev

I had to create a js file with:

Drupal.behaviors.front_showcase = function(context) {
  $links = $('.views-showcase-mini-list .views-showcase-navigation-box-field_link_url a', context);
  
  $links.click(function() {
    var href = this.href;
    window.location = this.href;
  });
}

I hope this helps.

Edit: That code is for D6, use the following for D7:

(function($) {
Drupal.behaviors.front_showcase = {
  
  attach: function(context, settings) {
  
    var $links = $('.views-showcase-mini-list .views-showcase-navigation-box-field_slide_link a', context);

    $links.click(function() {
      var href = this.href;
      window.location = this.href;
    });
  }
  
}
})(jQuery);
imoreno’s picture

Hi, thank you for the code.

where do i need to place this code exactly? in the module JS file? other place?
Please advice.

BR
Itzhak

lucascaro’s picture

@imoreno you can put that code in any js file you add using drupal_add_js (mine was included by the theme).

imoreno’s picture

Thanks lucascaro,
I just did, but still the title/link is does not linked to the node itself - just links to the anchor.

Any ideas how to debug this one?

BR
Itzhak

lucascaro’s picture

The best way is using either firebug or the debug tools in chrome, check that the script is loading, and that it's being executed by the browser. You might also add an alert in the js to check that it's running.

Also, clear the caches just in case...

imoreno’s picture

After Detailed testing.
#2 for drupal 7 does not work for me....

imoreno’s picture

Status: Needs review » Closed (fixed)

Hi,
My Mistake,

This script is working as expected.

BR
Itzhak

Madrugada’s picture

The code at #2 worked great for me. The problem had been that the slideshow navigation images changed the main showcase images, but below those images was another link which went to directly to a node with more information.

For those of who are using Drupal 7 and share my problems in immediately making sense of simple code, you may have to change this section: '.views-showcase-navigation-box-field_slide_link' to match the name of the field (in the view) that contains the link.

imoreno’s picture

Status: Closed (fixed) » Needs work

Hi,
It works great if there is only one slide.
If you have 3 or more, it is broken and only the picture can be linked.
the description text can't be linked.

any ideas?