Drupal How to get a view to display as columns rather than rows

11,154

Solution 1

If you're using Views 2, one way would be to create a table view, then use a custom views-view-your-view-name.tpl.php file to output the columns and rows vertically rather than horizontally. That template override gets the rows and columns as arrays of objects that you can output however you'd like.

Solution 2

I don't think Panels are good answer to this question, the have different purpose.

I would maybe use a view which is sorted by custom parameter in URL, set output as list (so it is li div.title Title, div.date Date, div image Image /li etc), and style the list with css (.li has fixed size and float:left;).

Then I would a "sort by" selector before view (there is a field for HTML that will be repeated before any view output - [a href="?sort=Name"]Sort by name[/a])

Solution 3

You might be able to use multiple views and panels. Check out the panels module

Share:
11,154
frankish
Author by

frankish

Worked most of my career in Linux/UNIX environments with Perl, Java, Sybase. Worked as a Developer, QA Engineer and UNIX Systems Admininstrator I like to ask the good questions so all can benefit from the answers. Hard to beat the fastest guns in the west around here. ;-)

Updated on June 05, 2022

Comments

  • frankish
    frankish almost 2 years

    I am trying to get a drupal 6 view to display in a column format rather than rows. Basically I want to group my pictures/video by taxonomy and display them in a table. Similar to what I have below. I tried enabling grouping with a grid layout but that did not seem to do it.

    Cows Horses Dogs Cats
    Picture Picture Picture Picture
    Picture Picture Picture Picture
    Picture Picture Picture Picture
    Picture Picture Picture Picture
    Picture Picture Picture Picture

    Hope this makes sense.

  • David Wees
    David Wees about 15 years
    Eaton's plan here is the best one. Alternatively you could roll your own style plugin for Views.
  • Muhammad Hashir Anwaar
    Muhammad Hashir Anwaar almost 14 years
    Yes I read this answer (18 months later) and thought it was off topic. Then I realised it was me. I think I might vote myself down here...