Probably a stupid question. I'm more used to Drupal 7, but I'm working on a new site today and it's Drupal 6. There is a Views Slideshow on the home page. The buttons and images automatically cycle. We want to add a link to each button/image so people can click and go to a related page.


I looked at the nodes for the content used for each image and I was surprised that there is no field to store a link--as is common in most slideshows I see now.

The Links module is installed, but again there is no Link field type in the node content used to store each image/button in the view.

Looking at the HTML, I see that there is no href for each button or img. Apparently one can hover over a button to switch visible images, but cannot -click- to go to another URL.

What's the preferred way to add a click URL to each of the images and/or buttons in the view?


1 Answer 1

  • Add a link field using CCK for the content type.
  • override the label output to include the rendered link in the View.
  • OK, I'll need to change the Row Style to Fields and create the fields I need. I am unclear as to what replacement patterns I will need to use for the link. 1) Should I use Rewrite option and then type in something like '<a href="[field_button_url_url]" img src="field_img"..etc. Or should I use the 'Output This Field As A Link' option? And if so, what replacement token should I use? Any specifics would be appreciated! TIA.
    – jchwebdev
    Aug 7, 2013 at 19:12
  • your questions depend on how far you intend to theme it -- but you have the correct questions. I recommend your first approach with the <a href= ...> tag, although i think all you need is the href and no img src. You can accomplish the img src stuff solely with CSS ... you just want to fix the link tag itself.
    – tenken
    Aug 7, 2013 at 20:49
  • Thanks. I think I'll wait until 2am to try this. :D Back tomorrow with success/failure.
    – jchwebdev
    Aug 7, 2013 at 20:54
  • Well, that didn't go so well. When I converted the Row Style to Fields, this immediately made the Slideshow stop working so I stopped. Any idea -why-? The generated SQL seems very different... which suprised me since there is really only one field in the node besides the usual 'weight' etc.
    – jchwebdev
    Aug 8, 2013 at 16:49
  • 2
    For any future travelers, the 'trick' such as it is: 1. Add a plain text field to the Content Type. (I tried using a 'Link' type, but this kept generating -crazy- html and I just needed to get 'er done.) 2. By default, the Slideshow appears to work with the 'Node' row type. You have to change to 'Fields' and then change the Slideshow Style options and check the image field in the 'Main Frame Field' box. 3. You then need to make sure the Image field is set with a picture type of 'Picture'. 4. The code for the Rewrite Output is then: <a href="[field_link_url_value]">[field_my_image_fid]</a>
    – jchwebdev
    Aug 15, 2013 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.