0

I need to create a page on my Drupal website which shows colleague images (colleague profile pics).

I want to position 2 colleagues pics next to each other on row 1 then underneath show 3 images on row 2, as shown in this picture:

enter image description here

I have set up a content type called Colleagues, which has fields of Title and Image. And I have set up a View to read that content and display the images, and the title underneath.

I can display them in whatever order I need, but how do I display them so that there are 2 at top and 3 underneath?

The only way I can think of is to add a field called Row Number, and create 2 Views for each row and display them accordingly, but that seems messy.

Can anyone help?

2
  • 1
    This is a CSS issue and you can use nth selectors etc. Else do it in the Views template where on the row count you would open or close one of the two wrapping divs. Commented Mar 3, 2016 at 10:46
  • ok, i will ask on the Stackoverflow site Commented Mar 3, 2016 at 11:14

2 Answers 2

1

You can define attachment display of view, in which u can display only 2 images with offset 0 under Pager section. and in page you can define image to show as 3, with offset as 2.

As attachment loads above the page, so it will show the structure accordingly.

1
  • Easiest and best solution. Modifying theme files for a simple issue just causes hassle if more than one person is working at it. Commented Mar 4, 2016 at 5:15
0

Maybe you could get what you want by modifying the theming files for your specific view.

If you go to your view edit page, in Advanced >> Other >> Theme: information you can take a look at which files are being used to construct your view.

Then, if you look at the Style output default file, you can see how the table is being made.

You can implement your own template for the table, by adding the corresponding file views-view-table--your-view-name--displayname.tpl.php to your module/theme folder.

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.