Drupal 7 Views Fields
Fields in Drupal Views 7 | Video User Guide
Fields in Views is very useful to customise the on-screen display for a view. Views fields is able to use all the content and taxonomy fields from the Drupal database, including user created fields. Fields can also be used to sort data displayed in the view.
Adding a Field to a View
Using the sample article list view from early video tutorials, a fields gets added by selecting 'Content' under the 'Format' title. The configuration panel provides a checkbox to select fields. Apply the configuration setting and the next panel has another few options to add a title, use a separator, and to hide empty fields in the view.
choice of fields. This can be a very long list as all available fields for every content type will be included. To make the choice easier, the panel includes a drop-down menu to narrow the options by content type, or the search form can be used to find a relevant field.
Views Field Configuration Panel
Returning to the configuration panel reveals a new section labelled Fields has been added to the panel with a list of added fields below. Selecting a field from the list opens the views field configuration panel.
The Field editing (configuration) panel has several areas or groups of settings available. First off are three options to;
- Link this field to the original content item
- A checkbox to create a label which adds a label input field to the panel
- and an option to exclude the field from displaying on the site.
Below this are four minimised regions for; 'Style Settings', 'Rewrite Results', 'No Results Behaviour', and the ubiquitous 'More'
Style Settings for Views Fields
First option is to wrap the field, the label or both with HTML markup; an HTML element e.g. <h> markup and CSS class. Another option exists to use default CSS classes instead. This ability allows a lot of control over styling the fields as the user can even add additional custom CSS classes to the site for views to call on.
This guide also looks at adding multiple fields to the view, however 'Rewrite' and 'No Results' are the subject of another video.
Many More Fields and Options in Views
Views fields has as many options as content types and available fields. Discussing each and every one of the possible combinations is way beyond the scope of this 17 minute fields primer. Every site will have different options as well - a large site could end up having thousands of available fields and their related settings for views to make available to the user