Customizing a View

Events happening in the community are now at Drupal community events on www.drupal.org.
Sigal's picture

Hello,

I'm trying for 2 days now to customize a view to look like I want it to look with no success.

I have a view of node type that has 3 fields:

Title
Image
Link

I want the view to look like a table, where each field is in a column, and each field type is in a row.

For example, the table should look like this:

Title A Title B Title C

Image A Image B Image C

Link A Link B Link C

I tried changing the tpl files for a table and grid views, but the problem I have is that the view prints each row at a time and not each field, as a result, all the fields are printed in the same row and column, which makes the titles appear in different heights according to the image height.
I want all the fields to align horizontally.

I'm attaching a picture since it's very hard for me to explain what I mean :) and my tpl file.

Can someone please help me?

Thank you,

Sigal

Comments

Attachments?

Nightwatch-gdo's picture

Attachments?

Hmm, actually, I get what

Nightwatch-gdo's picture

Hmm, actually, I get what you say... I thought about the possible need of turning the table so that records are displayed vertically before, but I never actually ran into it...

OK, so I played around, and

Nightwatch-gdo's picture

OK, so I played around, and this may be a bit of a kludge, but:

Say your view is called Listing, then add views-view-table--Listing.tpl.php as attached having set your view to table style.

Which would render as attached. The top table is the one I think you want, right?

Hi

Sigal's picture

First thank you for trying to help :)

But my attachments and yours do not appear on the posts.

Drupal bug?

I'm trying to attach a file again, just to see if it is attached.

Yes, funny, they did show in

Nightwatch-gdo's picture

Yes, funny, they did show in the preview. E-mail me at info@burtronix.co.za and I'll reply with the files.

Done

Sigal's picture

Ok, with Nightwatch help and with a clear head, I managed to solve this problem.

If anyone is interested in the solution, you can send me a message and I'll send you the tpl file.

I would attach it here, but it looks like the attachments option does not work.

Cheers,

Sigal

South Africa

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: