Tuesday, August 6, 2013

What's new in Views 3

Views 3 is the newest major revision of Views. Views 3 retains all of the core functionality of Views 2, retaining the Views 2 interface (Views 3 for 7.x has a brand new interface). Views 3 incorporates a number of new features as well as pulling in much wanted features from a few add-on modules that were written for the 2.x branch.
Major changes interface include some movement of familiar features, and additional options for some of these features.
There's not a huge difference from the previous Views 2 interface, just an added filter for Status:

Views 3 admin interface
Context-help is available by clicking the small blue question-mark icon. Context-help in Views 3 is provided by the Advanced Help module, so make sure to install that together with installing Views 3. The small blue help icons will be available in various parts of the Views UI. In particular, look for them as part of the description of a display, when setting style options, and in various editing sections such as pathmenu and the like.
The filter header now includes the Status filter. This enables you to filter your Views list by whether the view is enabled or disabled, allowing you to effectively narrow your list when you're looking for an active view.
Major new features:
  1. Views Or has been incorporated.
  2. Semantic views have been incorporated.
  3. The Jump Menu style has been added.
  4. The Panel Fields style has been added.
  5. Pluggable back ends
  6. Pluggable text areas, pagers, and forms
  7. Translation plugin
  8. Exposed sorts
  9. Adding a view

    So let's jump in and add a view. For this example, we're going to create a user view, which will display a list of users.

    Adding a view
    The first step in adding a view is simply entering a name (only alphanumeric characters, no spaces) a description, tag, and the view type. To get the user view, we selected the User radio button.

    Configuring the new view
    Let's start by adding some fields:

    Adding fields
    Clicking on the [+] icon next to the word Fields unfurls a section beneath the view information with all the available fields grouped by Comment, File, Node, Node revision, Taxonomy and User, and probably a few others. This is a general paradigm for the Views 2 interface -- clicking on a widget or link unfurls a section beneath the view information with the relevant interface. Usually, what is being edited will be hilited in yellow, as well.
    When adding items, you can use the Groups drop-down box to show only a subset of the fields available according to the above groups, or select All to see all fields available, which is what was selected when the section unfurled. For our example, we're selecting the 'User' group and adding the User: E-mailUser: Name and User: Picture fields.

    Adding fields
    Once we add our fields they show up in the Fields section of the interface. We will be walked through each field we added, so keep clicking update, even if you don't make changes to the field and you will see the next one.
    The fields we added can be rearranged by clicking the up/down icon, right next to the add icon we used earlier. We can also remove a field using the same interface.

    Rearranging fields
    From here, the fields can be dragged up and down by grabbing the little drag handle on the left and moving them where you like. Making a change to any part of the view by clicking update usually triggers a refresh of the view preview which is conveniently located right below the main interface.

    Views preview
    Now that we have some fields set up we can turn our attention to Basic Settings for the view.
    It's important to note that all the interface elements pertain to the current Display selected for the view. As mentioned before a view can have multiple displays. The first time you create a view you'll be manipulating the Default display. You can add displays using the Add Display button, whose Basic Settings are completely different from each other; this lets you have as many displays of a view as you would like all sharing items such as Sort Criteria, Filters and Arguments but different display settings like Title, Style, Fields, and Pager settings. Also, any display you add automatically inherits display settings from the default display initially, so you can keep a core of common settings in your default display and add additional settings for every other display.

    Adding a Page display
    Let's stick with the Default display and twiddle some settings. We can set the Title to "User View 1" and the Style to Table.
    In Views 3, view styles control how a view display looks. There is now the style as well as the row style which focus on different parts of the output. Styles have been moved to their own "Style Settings" box in the UI.

    A breakdown of View output
    We change the style by clicking on the current style on the left hand side of the View information area.

    Selecting a Views 3 Display Style
    We're given the style options of GridListTable and Unformatted. Additional display styles can be added by modules which have Views style plugins. Choosing a style reveals a "settings" button which you can click to configure the style you've chosen. In the shot below we've selected and are configuring the Table style, which we're using to produce a more compact output than we had earlier.

    Selecting and configuring the table style
    ... TODO: Finish this document ...