Search code examples
drupal-7drupal-fields

Drupal 7 - how can I control content layout in a view?


I've been handed a design spec which requires a news listing in a specific format - e.g. image floating to the left, with the main title and content on its right.

I've created the articles listing using the views module and embedded the view as a block on the front page. However, I need to change the layout of the resulting list of items at an html level, as the items are not provided in the order or within the html tags that I need in order to deliver the design.

In order to style the output, I really need the views module to give me fine-grained control over the html tags being wrapped around each field for each article.

Is this possible in Drupal?

(edit: please note, this is not a css question - I know how to float and position things in css. I need to be able to modify the html tags applied to fields in a view - thanks!)


Solution

  • When you go to your view, you will see FORMAT. You can change the Format to HTML list with corresponding settings. Under Show, you will say Fields. In the FIELDS area, choose which content you want enabled. Let me know if this helps, or if you want more of an explanation. Go back into your view and click on your field. The next window that pops up should be to configure that field. You'll see style settings where you can define the HTML tags, classes, wrappers, etc.