Getting Started: Setting up Your First View
Prefer to watch a video? Check out our "Intro to GravityView" below:
Next, we need to define how we are going to start our View. There are two ways to create a View: starting fresh or using an existing form as the data source for our View:
1. "Start Fresh" means you will use a GravityView preset template form instead of an existing form. When you save the View, GravityView will create a new form for you in Gravity Forms. The created form will include all the fields you need for each preset purpose:
2. If you decide to "use an existing form", your View will use the existing fields on that form and then you will need to select a layout from one of the above:
More about the differences between these four View types.
For our example, let's use the Table View, which is our most common layout.
After selecting a View type, the View Configuration meta box shows up. In this meta box, we will find three tabs at the top which correspond to the three available pages on the front-end of your website: Multiple Entries, Single Entry, and Edit Entry pages.
- The Multiple Entries page is the main table of your View, where your form entries will be displayed one after another in separate rows, each row is an entry and each column in a row is a field from your form (assuming you are using the Table View layout).
- Sometimes your entries have so many fields they don't fit in your main table, that's why the Single Entry page exists, to show additional entry fields.
- If you want to edit data from an entry, you do that on the Edit Entry page. In this page, you can select which fields from the entry are available for modification. This page can be accessed through a link put on the Multiple Entries page or the Single Entry page.
Now that we established what each of these three tabs (also called screens or pages in the front-end of your website) are used for, we can start adding fields to them.
The Multiple Entries tab
This tab is divided into three sections:
- Above Entries Widgets
- Entries Fields
- Below Entries Widgets.
Let's make a brief stop here to explain two important concepts that we need to understand: Fields and Widgets:
- Fields come from your entry, they are the same fields that exist in your form.
- Widgets are tools for your table, like a Search Bar or Pagination links, they are not specifically related to your form or an entry.
This being said, on this tab, you have two main sections to add Widgets ( above and below your table) and just one section to add Fields (your table). Each
Check out this article to read more about Widgets.This is how the Multiple Entries tab will look like on the front-end of your website:
The main difference between the Multiple Entries tab (or page) for the Single Entry and the Edit Entry tab, is that the latter two does not support widgets, just fields.
If your entries contain too much data, it will be wise to display the most important fields in the Multiple Entries page and leave the additional information to the Single Entry page. To do that, you will need to add a link to the Single Entry page in your main table. That can be done basically in two ways:
1. Link to the Single Entry page using an existing field
After having added at least one field to your table, click on the cog icon next to the field's name. A pop-up window will show, these are the options for that particular field. Check the option called "Link to single entry". by doing that, a small chain icon will show up next to the field's name, indicating that field will contain a link to the Single Entry page.
2. Using a dedicated field to add a link
GravityView contains two special fields called "Link to Entry" and "Edit Entry" which will automatically add a new column to your table to link to these two respective pages.
Here's how they will show up on the front-end of your website:
The process for the Single Entry and Edit Entry page is quite similar, you will just need to add the additional fields you want to display (Single Entry) or the fields you want your users to modify (Edit Entry) and that's it.
Now, we just need to Publish our View and copy the shortcode to embed it in a Page or Post:
We can paste the [gravityview] shortcode directly into the Page (or Post) editor, or we can click that handy "Add View" button to select our new View to add to the page:
Of course, there's more to it, than this article can cover, for example, in this next tutorial, we will cover all the View settings.