On our blog, we recently featured a case study of one of our users, Adam Cavotta, who is a Senior University Training Specialist at New Mexico State University. NMSU uses GravityView in nearly 10 different ways. In this ongoing blog series, we’ll teach you how to create similar applications for yourself.
Want to read more about using GravityView at universities, schools, and other educational institutions? Check out our guide.
In this post, we’ll create a searchable database for research projects. Our final product will look like this:
Our research projects database will have the following functionality:
- Allow professors and researchers to post and continually update research projects
- Allow students to browse and search through research projects
Let’s get started!
Step 1: Create a Form
First, you’ll need to create a form in Gravity Forms. To do this, go to Forms > New Form on your WordPress sidebar.
Name the form “Submit a New Research Project.” This form will allow professors and researchers to submit their projects to the database.
Now we need to add some fields to our form. We want each research project to have the following fields:
- Project Name
- Faculty Member
- Number of Students Sought
- Number of Students Already Selected
- Link to Application Page
Let’s go through and create a field for each one. To add a field to the form, click on it or drag it to the left into your form.
For Project Name, we’ll use a Single Line Text field. Be sure to rename it. You can also limit the field to a certain number of maximum characters.
For Faculty Member, we’ll use the Name field, which is under Advanced Fields. We could also just use a Single Line Text field – it depends on your particular needs.
Don’t forget to rename the Name field to “Faculty Member”. You can also add a description.
For Keywords, we have a few options. The simplest solution is to use a Paragraph Text field, which will let users type in any relevant keywords. You can also use a List field, which will allow you to keep each keyword separate.
For this example, we’ll stick with the standard Paragraph Text field.
Want to make the text input box smaller? Click on the Appearance tab in the field settings and change the Field Size option.
For the Department field, we want to use one of the following:
- A Radio Button field, if a project can only belong to one department
- A Dropdown if a project can only belong to one department + we want to keep our form as compact as possible
- A Checkbox field, if a project can belong to more than one department.
We’ll go with a Dropdown for this example. Once you add the field, don’t forget to add your choices.
For Description, we want to use a Paragraph Text field field again.
For Number of Students Sought, we’ll use the Number field. If you anticipate researchers having projects with a non-specific number of students sought (e.g. 5-10, “as many as possible”, etc.) then you can also use a Single Line Text field.
For Number of Students Already Selected, we can also use a Number field. This field will be useful for researchers to update on a regular basis (more on how to do that later!)
Finally, for the Link to Application page, we can use the Advanced Field, Website. Don’t forget to rename it.
We’ll have another guide coming soon on how to create this application page. For now, check out our Job Applicant Management System post – it is a fairly similar process.
Now that we’ve created our form, let’s put it on a page. Press Update and then create a new WordPress post. Under the title bar, click Add Form and select the form we created.
Then save and view the page.
Everything looks good! Let’s move on to the next step: Creating a View.
Part 2: Creating a View
Note: For this part, we’ll assume that you’ve added a number of research projects to your form already. Already have a file of research projects and want to import it? Not a problem. Check out our Import Entries plugin.
Now that we have a form, we need to create a View. A View will let us display and modify this information on the front end of our WordPress website. To do this, go to Views > New View on your WordPress sidebar.
Title your View “Browse Research Projects” and select the form we previously created (“Submit a Research Project”) as your Data Source.
Now we need to chose a View layout. For this project, we want to use a Table layout. This will display our research projects in a table (that looks like a spreadsheet).
Now we are on the View Configuration page. We’ll start by customizing the Multiple Entries page. This is the “default” page that visitors will see upon navigating to our view.
At the top, we can add some widgets. Let’s add the Search Bar widget to the top.
To edit the settings of a widget, click the blue gear icon next to it. If you scroll down, we can also add widgets at the bottom, below the Entry fields. Let’s add Show Pagination Info and Page Links here.
Now, let’s add the entry fields themselves. To add a field, simply click +Add Field. Then, select the field you want to add.
Since our Multiple Entries page displays many entries at one time, we should only add a handful of entry fields. Let’s add the following:
- Project Name
To edit the settings of a field, click the blue gear icon next to it. We want to link the Project Name field on the Multiple Entries page to its more detailed entry (called “the Single Entry page.”)
To do this, click the blue gear icon next to Project Name. Then, check the box next to Link to single entry.
Now let’s publish our View and see what it looks like. Click Publish then View on website.
Everything looks pretty good! If we click on a project name, we’ll be taken to the Single Entry page. We haven’t set this up yet, so let’s do it now.
The Single Entry page is the “more detailed” page for our entry. Since it is a single page that covers only one entry, we have more space for adding fields.
To add a field, click +Add Field. Be sure to add all of the fields we created.
Now save your View and preview it again. Click on a Project Name field and you’ll see the Single Entry view.
As you can see, all of our fields are listed. Everything looks good!
Finally, at the bottom of the View Configuration page are View Settings. There are a number of options here, but two in particular are relevant for our research projects database.
Allow User Edit + Allow User Delete
If enabled, Allow User Edit and Allow User Delete (which are under View Settings) allow users to edit or delete their entries after they have submitted them.
The Edit functionality is particularly useful for our Number of Students Already Selected field, as it will allow researchers to conitnually update how many more students they need for their project.
Sort by Field
By default, all entries on the Multiple Entries page will be sorted by the date they are created. However, if you want to organize and filter the research studies by a different field, like Department or Faculty Member, you can do that here.
And that about wraps up our guide to creating a research study database with Gravity Forms and GravityView!
In an upcoming guide, we’ll walk through creating the other half of this project – a form and View for students applying to research projects.