To follow along with our Drupal Views tutorials, set up a Drupal site loaded with our 4 custom views and baseball stats content that will make querying in Views a bit more interesting and meaningful.
By the end of this tutorial, you should choose a solution and follow the instructions for creating a Drupal site loaded with our starting point content and views.
- Set up a Drupal site with a starting point containing baseball stats content and 4 custom views.
- Ability/permissions to download software to your local machine.
- Install Drupal Locally with DDEV
Recommendation: Use DDEV to install Drupal
We'll use DDEV to install Drupal and import a database starting point that contains the content and views for our Views in Drupal tutorials. We've copied instructions from the Drupal Official Docs Local Development Guide in the following steps.
Install Drupal with demo content and configuration
Install DDEV and create a new Drupal application
Follow the instructions in Install Drupal Locally with DDEV to get an empty Drupal site running. Then follow the remaining steps to populate it with sample data to use while learning Views.
Create a new directory in your project called db-dumps
In the root of your project, create a new directory called db-dumps. This is where we'll store a database dump which we'll import and populate the site with content and configuration.
Download our database starting point
Select the Download button from that page and save the file to your project's db-dumps directory.
Import the database with ddev's import-db command
In a Terminal window, navigate to the root of your project and run the following command:
ddev import-db --file=db-dumps/START-d10-views.sql.gz
Get the local URL for your site
ddev launch and DDEV will open up the local site URL in your browser.
If you notice any un-themed pages, clear all caches by using the Manage administrative menu and navigating to Configuration > Performance (admin/config/development/performance) and selecting the Clear all caches button.
Log in (at path user/login) with username:
You are now ready to follow along with any of our Views: Create Lists with Drupal tutorials.
In this exercise, we installed Drupal and imported a starting-point database with content and Views. We will be using this as a starting point for the tutorials in Views: Create Lists with Drupal.
Further your understanding
- Do you have a documented, repeatable, and reliable process for setting up a local development environment with Drupal? There are many options to choose from. Take the time to find a solution that works best for your operating system, use case, and knowledge base.