On this page
Panels 2: Adding a node to a panel page
The recommended method for adding a node to a panel page is as follows:
- Navigate to the Panel Pages List at admin/panels/panel-page.
- Click 'Edit' at the end of the row of the page you wish to add the node to.
- Go to the 'Context' tab.
- Under the Contexts section on the right, select 'Node' and click Add.
- Select the node you want.
- Save the node selection configure screen.
- The configuration pop up goes away. Save the page.
- Then go to the Content tab. Click any add content button. You will notice there is a section you do not normally see named 'Node context'. Any of these panes will allow you to display a node or information about a node. Use the 'Node content' pane under the 'Node context' section to do a basic node view.
For advanced theming
- In the 'Node content' add config dialog, there is an item called the 'panel_identifier', which you can use to get maximum control over the presentation of the data and be able to automatically use different panel-based templates depending upon what you enter in that field. In your _phptemplate_variables, you can use a piece of code like this:
// under case 'node', assuming the variables array is named $vars:
if (!empty($vars['node']->panel_identifier)) {
$vars['template_files'][] = 'node-panel-' . $vars['node']->panel_identifier;
}
Alternative method for adding a node to a panel page
If the power of the above method is not needed or not wanted, there is always the legacy nodes module. Panels legacy nodes does not have a normal administrative UI, such as panels pages or mini panels. With this module, users may add a node directly to a panel via the add content interface. They may then select this node using an auto-complete field. In general, this method of adding nodes to panes should be considered deprecated and is only retained to support updating sites that use this older method. Moving forward, it is recommended that the context system be used to embed nodes, as that is far more powerful and interesting.
helping newbie (and OG Pages) users
In the default installation of the latest OG Pages and Panels, there is no simple way (default configuration) to include a node in the layout. This is one of the first things people will want to do, and it's in the video, but you don't see Node Content as an option for a new item. (I actually raised this first as a Pages issue: http://drupal.org/node/250469.)
I think this page contains the key information needed to add a node, but it doesn't mean much to a person trying to figuring things out for the first time (and it looks hard -- being in a hurry, I just enabled the deprecated Alternative Method -- thanks very much for describing it). If you could add some words to explain things for newbie and Pages users (go to the 'Contexts' tab *where*? Content tab where? will these steps even work for Pages?), it would be a huge boon. (And you are welcome to delete this comment!)
For those looking for this info: Go to the Contexts tab by visiting admin/panels/panel-page, and clicking on Edit for the page (panel) you want to add a node to. This brings up a page on which contains the tabs Context and Content. Within the Content tab, you may also see multiple tabs for each of your content types; be sure you have selected the right one.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion