Panelize all the Things!
Panelize all the Things! A Talk About Panelizer Drupal Pittsburgh Meetup October 14, 2014 David Trainer Minimal Media @minimalmedia minimalmedia.com/presentations/panelizer
panelize (pan-l-ahyz) v., used with object 1. To attach Panels functionality (to a Drupal entity)
What Does Panelizer Do? Attach Panels functionality to any entity Customize available layouts and default content for any entity type
What Does Panels Do? Allows content editors to choose interesting content and easily manipulate it's position within a layout
Why is Panels Necessary? We already have the block system
Why is Panels Necessary? We can move blocks between different regions
Why is Panels Necessary? Each block has a whitelist
Why is Panels Necessary? Much more efficient interface than blocks, even blocks + context, especially for inexperienced users Block system has a dangerously broad scope Damage control: Panels confines editors to a node at a time
Why is Panels Necessary? “Panels is a tool for unusually sophisticated and ambitious content editors, who can't be trusted with the keys to the entire block system”
Demo Let's panelize something already
Demo You can get all this panels hotness inside of 10 minutes Without writing any code Essential modules: ctools, panels, panelizer
Demo – Panelize a node Add content type Why create your own content type for this? Reusability You don't have to use the Panel content type, you can panelize your existing content types, and all this panels configuration is exportable!
Demo – Panelize a node Add content type Full page override (you can panelize different view modes) Leave no default panel Panelize a single node
Demo – Panelize a node Gotcha! Override node_view with Ctools page manager “The most common use case [for Page Manager] is to hand over the layout, and rendering of the path, to Panels.” http://drupal.stackexchange.com/questions/35186/wha ts-the-difference-between-page-manager-and-panels
Demo – Default Panel Configure the default layout and content of panelized entities devel_generate some users & Articles Change their layout, without writing a template Editors can still override the default Your panelized entities can offer multiple configurations to choose from
Demo – Views Content Panes “Like blocks, but smarter” Add a view content pane to Articles List all the Articles by that author View content pane → UID contextual filter Panel context → Node author relationship Pane settings → %user:uid and %node:nid tokens
More Interesting Panels Layouts Omega Write your own https://www.drupal.org/node/495654
What Have we Learned? Panels layout tools are powerful and accessible Panelizer default panels let you manipulate the layout of many entities all at once Views content panes are super useful You can fine-tune control over layout with your own custom Panels layouts
Thanks merlinofchaos EclipseGc on Page Manager: https://www.youtube.com/watch?v=gV0xs89mIOY Johan Falk: Page Manager + Panels + Views Content Panes integration: http://nodeone.se/en/learn-page- manager
minimalmedia.com/presentations/panelizer Q&A @minimalmedia minimalmedia.com/presentations/panelizer