0

In Drupal 7, I have created a custom gallery, but all images are showing in only one column.

I have Bootstrap theme for Drupal. I'm using the modules Views (Bootstrap), Colorbox, Multiupload Imagefield Widget, Multiupload Filefield Widget (both for multiimage uploads).

Steps I took:

  1. I created a new content type Gallery
  2. Added an image field to the content type and selected multiload (to enable upload of several images at once)
  3. Removed body field as I only need images.
  4. Image display has been set to Colorbox (I previously created different image styles - preview, full, etc.)
  5. In Views, I created a new page Galleries, which contains all galleries that I have on the site. I had no problems putting those Galleries in a 4 column layout. So basically this is a Albums view.

My problem is that when I click on Album name, a new page (of content type Gallery) opens. It contains all the images of the particular album. However, all the images are shown in only one column.

I have tried to change the layout with panels and display suite, but as Images are considered as one field, the end result stays the same. Is there any way I could change the steps I took and do this differently, so I could have the Gallery with listed Albums as I have now, and then when I click on albums the images are shown in 3 or 4 column layout?

Thanks

0

Its has multiple ways to do that but I recommend you to do it with views.

Create a new views as block view and follow the following steps:

  1. Add image field in fields
  2. Add filter criteria
  3. You can change the FORMAT of the views as you like (according to your requirement you should select Grid type) to display images in multiple columns.
  4. Add a contextual filter with nid (node ID) field and set it like this
  5. Save the views and go to admin/structure/block and enable your block
  6. Don't forget to hide the image field in the manage display of Gallery Content Type, path is admin/structure/types/manage/CONTENT-TYPE/display

Image as Example

enter image description here For more details, click here

  • Thanks for your answer. I will give it a try, though I'm trying to understand the logistics behind this solution. I have several albums, that I can show as a grid on one page (Galleries) - used Views. But when I click on specific album, it takes me to the album page. This is where the problem is. In point 5. you say enable your block. I only then need this block on album pages (lets say content type album). Would this work on every album page I create? – prima Mar 7 '18 at 14:17
  • Yeah it'll work on every node of type Gallery. – usmanjutt84 Mar 7 '18 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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