Good day. On the Drupal 7 site http://nevskylimo.ru/ it is required to make the images on the main page open in Colorbox. The main page is a "view".

On the pages of specific materials (cars, limousine buses) which can be accessed from the main one - the pictures in the colorbox open without problems because they have the data-colorbox-gallery = "gallery-node-77-field_image" attribute. But the pictures that are collected in the views - they do not have this attribute. Apparently so it does not work.

A similar problem on the pages that open from the top menu - because The views also open, not the materials.

How can I overcome the problem and make the Colorbox work on the "views"?

  • How do these vyuhi form? output fields or announcements? - alexin
  • The fact of the matter is that announcements are displayed. When you try to display the fields (to use some of the hacks found on the Web) - the layout is completely broken and it seems to be more difficult to tinker with this than making pictures from announcements open in Fancybox. I noticed that the "a" tag of the surrounding image from announcements has the same class "colorbox init-colorbox-processed cboxElement" - however, the attribute data-colorbox-gallery = "gallery-node-64- field_image "(the value is typical, it happens differently). - NDanilov2015
  • I tried to add forcibly (jQuery to the rescue) this attribute - nothing has changed, as the pictures from the announcements in the Colorbox did not open, never open ... - NDanilov2015
  • Then you have to look at the pattern. What and how is it displayed there. Add the code to the question. - alexin

1 answer 1

Change the views in the widget pictures on the Colorbox.

  • See my comments above, I do not use fields in the view, but “output announcements”. Switching to margin mode completely collapses layout. - NDanilov2015
  • In the same way - in the management of the display of the type of material, for the image field to put the Colorbox format. - VVS