Panelizer (obsolete)

Panelizer allows supported Drupal entities to be treated as Panels displays, providing flexible default displays on a per-bundle basis with optional per-entity customization.

panelizer
9,825 sites
54
drupal.org

Install

Drupal 10, 9 v8.x-5.0
composer require 'drupal/panelizer:8.x-5.0'
Drupal 8 v8.x-4.4
composer require 'drupal/panelizer:8.x-4.4'

Overview

Panelizer is a powerful Drupal 7.x module that enables supported entities (nodes, taxonomy terms, users, and comments) to be rendered using the Panels layout system. This allows site builders to create customized, flexible layouts for any entity type without requiring custom code.

The module operates as a descendant and replacement for the "Panel Nodes" module that was previously bundled with Panels. It provides a plugin-based architecture that can be extended to support additional entity types beyond Drupal core's entities.

Each entity bundle (content type, vocabulary, etc.) can have each view mode configured individually. The module supports four operational modes: no default/no choice, with default/no choice, no default/with choice, and with default/with choice. This gives fine-grained control over how entities display and whether content editors can select or customize displays.

The module includes full revision support and integrates with both Revisioning and Workbench Moderation modules for editorial workflow management.

Features

  • Supports all Drupal core entities: nodes, taxonomy terms, users, and comments with extensibility for custom entities
  • Per-bundle and per-view-mode configuration allowing each entity type/bundle combination to have different panel displays
  • Multiple display selection support - entity bundles can have multiple default displays with per-entity selection
  • Four operational modes: No Default/No Choice, With Default/No Choice, No Default/With Choice, With Default/With Choice
  • Full content revision support with integration for Revisioning and Workbench Moderation modules
  • In-Place Editor (IPE) support through Panels for live editing of displays
  • Page Manager integration for full page override functionality
  • Views integration with custom handlers for filtering and displaying panelized content
  • Search API integration for indexing panelized entity content
  • Features module integration for exporting Panelizer configurations
  • Plugin-based architecture allowing easy extension for custom entity types
  • Context and relationship support for complex display configurations
  • Per-entity CSS class, ID, and custom CSS code support
  • Configurable allowed content types and layouts per entity bundle

Use Cases

Custom Landing Pages per Content Type

Enable Panelizer for a 'Landing Page' content type with panel choice enabled. Create multiple default displays (e.g., 'Two Column', 'Three Column', 'Featured'). Content editors can then select which layout to use for each landing page and customize the content within.

Personalized User Profiles

Enable Panelizer for user entities to allow administrators to create custom profile layouts. Users with appropriate permissions can customize their own profile displays within the allowed content types.

Taxonomy Landing Pages

Enable Panelizer with Page Manager override for taxonomy terms. Create different default displays for different vocabularies, allowing category pages to have unique layouts with promoted content, filters, and custom blocks.

Consistent Article Layouts with Per-Article Customization

Enable Panelizer for Article content type with a default display. All articles automatically receive the standard layout, but editors can override individual articles when special layouts are needed for featured content.

View Mode Specific Displays

Configure different Panelizer displays for the same content type across different view modes. For example, use one layout for full page display, another for teaser view mode, and yet another for search results.

Tips

  • For the Full page override view mode, it's recommended not to also panelize the Default view mode as they can conflict
  • Modifying Panelizer settings for an entity always requires the corresponding 'update' permission for that entity
  • Use context substitutions in CSS class fields for dynamic class names based on entity data
  • Store custom module data in $panelizer->extra which is a serialized array, but namespace keys to avoid collisions
  • When extending Panelizer for custom entities, copy the node plugin as a starting point and modify the handler class

Technical Details

Admin Pages 7
Panelizer /admin/structure/panelizer

Primary configuration page for enabling and configuring Panelizer across all supported entity types. This page displays a table for each entity type (node, user, taxonomy_term, comment) with checkboxes to enable/disable Panelizer per bundle and view mode.

Default Panel Settings /admin/structure/panelizer/{entity_type}/{bundle}.{view_mode}

Configure settings for the default Panelizer display for a specific entity bundle and view mode combination. Only accessible when the bundle has no panel choice enabled.

Allowed content /admin/structure/panelizer/{entity_type}/{bundle}/allowed

Configure which content types (panes) are available when editing panel displays for this entity bundle.

Layout /admin/structure/panelizer/{entity_type}/{bundle}.{view_mode}/layout

Change the Panels layout for the default display. Provides a wizard interface to select a new layout and optionally move content between regions.

Content /admin/structure/panelizer/{entity_type}/{bundle}.{view_mode}/content

Edit the content (panes) within the panel display regions. Uses the Panels editor interface for adding, configuring, and arranging panes.

Context /admin/structure/panelizer/{entity_type}/{bundle}.{view_mode}/context

Configure additional contexts and relationships for the panel display. Contexts provide additional data that can be used by panes.

Access /admin/structure/panelizer/{entity_type}/{bundle}.{view_mode}/list/{name}/access

Configure access rules that determine when this specific default display is used. Uses CTools access control system.

Permissions 7
Administer Panelizer

Fully administer Panelizer - customize which entities can be managed with Panelizer, manage their default displays, etc.

Administer Panelizer [entity_type] [bundle] defaults

Allow administering the default panel displays for this entity type and bundle combination.

Administer Panelizer [entity_type] [bundle] overview

Allow access to the panelizer overview page for the entity type/bundle. Required for panelizer tabs to appear on an entity.

Administer Panelizer [entity_type] [bundle] settings

Allow modifying the general panelizer settings for individual entities.

Administer Panelizer [entity_type] [bundle] layout

Allow changing the panel layout for individual entities.

Administer Panelizer [entity_type] [bundle] content

Allow modifying the panel content (panes) for individual entities.

Administer Panelizer [entity_type] [bundle] context

Allow modifying contexts and relationships for individual entity panel displays.

Hooks 8
hook_panelizer_defaults_override_alter

Allow panelizer_defaults_override to be customized, primarily for use by Features Overrides module.

hook_panelizer_operations_alter

Add custom operations to Panelizer objects. Operations can be performed on both panelizer defaults and individual entities. Data can be stored in $panelizer->extra (serialized array).

hook_panelizer_entity_plugin_process_alter

Allow customization of entity plugin processing during CTools plugin initialization.

hook_panelizer_overview_links_alter

Customize the links displayed on the Panelizer overview page for an entity.

hook_panelizer_delete_default

Act on default panelizer objects just before they are deleted. Use for cleanup of related data.

hook_panelizer_access

Adjust access to the Panelizer administrative interface beyond standard permissions. Return TRUE to grant access, FALSE to deny, or NULL to defer to other access checks.

hook_panelizer_access_alter

Alter the defined panelizer access definitions. Can override access decisions from other modules.

hook_panelizer_clone_panelizer

Modify a Panelizer object when it is cloned and before it is saved. Useful for modules that store references within panel panes.

Troubleshooting 6
Pathauto resets entity path alias when saving Panelizer display

Update Pathauto module to v7.x-1.3 or newer which fixes a bug that caused path aliases to reset.

Revisions not working correctly with Workbench Moderation and IPE

This is a known issue being addressed. See https://www.drupal.org/node/2457113 for updates and workarounds.

Panelizer tabs not appearing on entity pages

Ensure the user has 'administer panelizer [entity_type] [bundle] overview' permission. This permission is required for tabs to appear.

Full page override not working

Visit admin/structure/pages and enable the appropriate Page Manager page for the entity type (e.g., node_view for nodes).

View modes not appearing in Panelizer configuration

View modes must be enabled through the Custom Display Settings section of the entity's Manage Display settings page before they appear in Panelizer.

Too many revisions consuming database space

Panelizer 7.x-3.x is revision aware and duplicates panels for revisions. Periodically clean up older revisions to manage database size.

Security Notes 3
  • CSS code entered in the settings form is filtered for safety but should be used sparingly
  • Entity permissions (update access) are always required in addition to Panelizer permissions
  • The IPE (In-Place Editor) respects both entity update permissions and Panelizer layout/content permissions