0

I've been twisting and turning the View module but can't get simple tasks done. Well it should be simple but yet Drupal don't have a good solution ...yet.

How to create 2 columns where column A have an image that spans from top to bottom and column B have 3 rows?

  • do you want each of the rows to contain separate node information, or are you looking to group information from the same node together, while showing the image from the same node separate? – Geoff Jul 12 '14 at 15:49
0

I am afraid you will have to write custom code in this situation to get this done. What you can do here is create tpl file for your view with format as table and then in that tpl you can have your condition to make a table inside td.

You can fetch your views fields in tpl inside foreach ($row as $field => $content)

Make sure you have all the fields in your view which you want to display in table format.

  • The problem now is that I don't know how to code at all. Any good tutorials out there? – disallgbg Jul 12 '14 at 11:45
  • Well its not that difficult as it sounds. It is really a simple condition where you will have to check if it is the same field for which you want to display your table inside td. – Parwan Singh Bisht Jul 12 '14 at 12:19
  • Here is sample code for this. pastebin.com/kgYnxgYK – Parwan Singh Bisht Jul 12 '14 at 12:31
  • Thanks! Looked quite simple but how does this work? Do I save it as a views-views-field.tpl.php file or? – disallgbg Jul 12 '14 at 17:15
  • also, How do I get the setting for the fields that are done with Views (re-write results, links, exclude from display, relationships, teaser output etc.)? – disallgbg Jul 12 '14 at 21:40
0

Try Display Suite. It has an config option under Extras -> Other -> Views displays Manage the layout of your Views layout with Field UI.

This allows you full control to reorder the output of your views fields.

This is assuming as @Geoff rightly asks that your columns etc are for one result set.

If it is not, then I would think that you need to set the display of the image field to none, then group by the image field, and do some custom CSS.

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.