Creating Views Basic
To further understand views to be able to create our own let's look into how and existing view is set up.
To create or to alter a view we need to point our browser at the Views part of the Admin page.
Let's look at a view that we've already set up and change the properties of it. To do this we need to click on the Edit link associated with the view.
The next stage is where things start to get a bit scarey. The trick with views is to take it step by step and learn what each option does using examples.
Let's have a look at the way the Views page is laid out and check out some of the settings that are likely to want to alter for some of the view that we create in the future.
Understanding Displays in Views
The default display for the View is Defaults. We also see Page and Block which we saw the results of in the Introducing Views chapter. The idea is to set up the default settings with settings that will be the same for both the Page and Block display.
When these have settings have been set up then you would create other Displays based on the default one. In this example two have been set up Page and Block. These new displays can override the default settings, for example you might want to display more items in a Page view than in a Block view.
Understanding Settings in Views
Let's have a look at some of these settings to see what they might mean. Some are easy to work out.
Basic Settings: We have the Name of the current Display, Title of the view, How many items ot display, so some of these settings are clearly understood. Some of the other settings need more investigation for those unused to using Views.
Relationships: You can set nodes that this view relates to. I'm not sure how this works exactly. This example relates to a Comment Node
Arguments: The arguments allow you to set a dynamic elements to the view which can be set via the URL.
Fields: Here we set the fields that are displayed for the view. In this particular view, if we look more fields are selected for the Page display than for a Block display.
Above you can see that four fields are selected for the Page display of this View. And 25 items are set to be displayed.
Here we can see that only two fields are selected for the Block display of this Recent Comments View. Also only 5 items are set to be displayed.
Sort Criteria: Sort criterial affect the order in which the entries are displayed. In this example they are sorted by the date they were posted in descending order of date (desc) so the most recent appears first.
Filters: Filters allow you to exclude certain results or include only certain results. In the above example you'll see that there is a filter to only show 'Published or admin' which only shows users published nodes or ones which they have admin access to view.