Add 'rel' Attribute to Drupal Views Link
I am currently using Drupal 7 with the Views module. I have built a photo gallery that is running properly, but I am trying to integrate a lightbox.
However, to use a lightbox I need to image links to have the 'rel' attribute. Can anyon开发者_运维知识库e please help me with my problem.
How do you add the 'rel' attribute in Drupal Views??
In views, click on the link for the field. You will get into the configure settings for that field. One of them is "rewrite output for this field". You can output the field as arbitrary <a>
with the required rel
. (You can also try using the "Output this field as a link", that has many options for link but I don't see rel
there).
BTW I use views and the lightbox2 drupal module ( http://drupal.org/project/lightbox2 ) all the time in Drupal 6. Lightbox2 just works "out of the box" in Drupal 6 with Views. Consider using Drupal 6 for your needs as many modules aren't available in Drupal 7 yet.
As far as I am aware, you will have to do this in the theme. Override the view in your theme and add any attributes or additional HTML there.
You can use lightbox2 module. It is robust and it also does not require rel attribute which you can see here.
You can use a new module with name Colorbox link .Read its readme file and hope it will solves your problem as its available for drupal 7.
精彩评论