Panels and Page Manager in Drupal 8

 

Overview

The Panels module gives Drupal site administrators the ability to create customized layouts for various uses. Its drag and drop interface allows users to visually design a page layout and organize content within it. Learn more about Panels 

The architecture of Panels in Drupal 8 is largely the same as in Drupal 7. However, some of the functionality has moved around—for example, Page Manager is now it’s own module separate from CTools, and there’s the new Layout Plugin module—and the responsibilities of each have shifted a little.

Page Manager

The Page Manager module allows you to create special pages at custom URL paths (called routes in Drupal 8) that are made up of one or more variants. There are selection criteria used to determine which variant will be used. 

So, for example, you could create a front­page at http://example.com/home with two variants: one for anonymous users about your product, and another for authenticated users which shows the user’s dashboard.

It can also allow you to override existing routes and to change the way Drupal displays the content there.

For example, you could override the node/% path (which displays normal content) and have a variant for each content type on the site. Using the Panels variant type, you could chose a different layout for each content type, showing each of its fields in one of the various regions!

 

Panels

The Panels module provides a variant type that can be used by Page Manager, or any other module which uses variants—which are now a Drupal core concept. In fact, the standard Block module in core uses a variant to display the global blocks.

The variant type provided by Panels allows you to select a layout—provided via the Layout Plugin module—and place core blocks in any of its regions.

Unlike in Drupal 7, Panels uses core blocks, rather than its own special concept. This is possible because blocks in Drupal 8 are much more powerful. The same block can now be placed multiple times, and can be context-aware (there is now a Context API in core) so you can, for example, display a field from the piece of content currently being viewed as a block.

Layout Plugin

The Layout Plugin module allows modules or themes to register layouts by simply providing a YAML file and some templates, and for other modules to list the available layouts and render them.

It’s used by both Panels and Display Suite (an alternative to Panels), making their layouts interchangeable, rather than each module providing its own concept of layouts. The goal is to get as many modules that need to provide or use layouts depending on the same framework.

The goal is to get Layout Plugin merged into Drupal 8.1.0 core to make this the official standard!

CTools 

The CTools module provides some APIs and developer tools for other modules to use. Both Panels and Page Manager depend on it.

While most of the functionality in CTools got merged into Drupal 8 core, there are a number of things that didn’t make it that are still necessary. For example, it’s CTools that provides blocks for every field, so you can display an individual field from an entity—like a piece of content—if you have any entities in the current context.

Think of CTools as an incubator for Drupal core, and the goal is to try and eventually get all of its functionality merged into Drupal core in later point releases—likely later than 8.1.0.

When can I use it? 

At the time of this writing, Panels 3.0­alpha17 and Page Manager 3.0­alpha17 are available and provide some of the functionality of their Drupal 7 counterparts. 

While what they have works, using them in production is not recommended until after the first ­ beta1 release, currently targeted for after the BADCamp sprint from 10/22­10/25. At that point, we will start providing a beta­to­beta path and have a more fully featured administrative UI. But there will still be a long road until they’re feature complete.



This content was contributed by entrepreneur and Drupal developer, David Snopek.

D8 Panels

Get Involved

Despite the fact that Panels is used on over 110,000 sites (according to Drupal.org), there is only a small team working on porting Panels and related modules to Drupal 8. 

Help complete the Panels and Page Manager feature sooner so you can start building Drupal 8 sites ASAP! Join the weekly IRC meeting Tuesdays at 12pm CT in the #drupal-scotch channel on irc.freenode.net.

Start Your Drupal 8 Projects on Pantheon Today

For years you’ve seen the platform designed for Drupal, now see the Drupal designed for the platform.

Let’s get in touch

855-927-9387