Upgrade Your Drupal Skills
We trained 1,000+ Drupal Developers over the last decade.
See Advanced Courses NAH, I know EnoughUsing Panels to Build Page Layouts in Drupal 8
One of our OSTraining members asked about the current state of the Panels module in Drupal 8. They already had experience with Panels in Drupal 7.
Panels is one of the most popular ways to create page layouts in Drupal.
In this quick tutorial, we will show you have to create your Panel in Drupal 8. The process is definitely different when compared to Drupal 7, although many similarities remain.
For this tutorial, you do not need to have experience with Panels.
First, we need to install and enable the required modules to use Panels:
Although these next four modules are not essential, I'm also going to ensure I have the following modules installed, because I rely on them heavily for site-building.
Inside your Drupal site, go to the "Extend" tab and enable the modules:
Now we need to create our Panel.
- Go to Structure > Pages.
- Click "Add page":
- Choose an "Administrative title".
- Create a path for your panel.
- Make sure that "Variant type" is set to "Panels".
- Click "Next" when you're finished.
- Give the Panel layout a "Label".
- Click "Next" when you're finished.
- Select a "Layout" for the Panel.
- Click "Next" when you're finished.
- Enter a "Page title".
- Now you can add blocks to your layout in the exact same manner as adding normal blocks. Use the "Add new block" button to select the blocks you want to place in the panels for display.
- Once you've placed your blocks, click "Finish".
- On the next screen, select "Update and save".
If you want to do more advanced things with Panels, such as have different layouts for different user roles, you would create that from the "Selection criteria" area.
Now if you go to Configuration > Basic site settings, you can update the "Front Page" link to match the URL of your panel. Your panel will now be your site's homepage.
And now we have a 2 column, responsive Panel, as in the image below:
About Drupal Sun
Drupal Sun is an Evolving Web project. It allows you to:
- Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
- Facet based on tags, author, or feed
- Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
- View the entire article text inline, or in the context of the site where it was created
See the blog post at Evolving Web