I have trouble understanding the way that adding nodes to a panel works with the recent changes. Before, I could choose a specific node to add to a panel. I could still do that using the legacy module but this is something I wish to avoid. So, how would I do that with the current version?

We want to use panels for overview pages. On those, staff members should be able to add teasers to specific nodes (featured articles for example).

Comments

merlinofchaos’s picture

The recommended method for adding a node to a panel page now is as follows:

Go to the 'Contexts' tab.

Under the Contexts section on the right, select 'Node' and click Add.

Select the node you want.

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.

In the 'Node content' add config dialog, there is an item called the 'panel_identifier'. 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;
  }

That will then let you automatically use different panel-based templates depending upon what you enter in that field, giving you maximum control over the presentation of the data.

nath’s picture

Thank you for the explanation.
So it seems one can do a lot more now, but it has also gotten more complicated (an additional step required). :-\

merlinofchaos’s picture

Status: Active » Fixed

If the additional power is not needed or not wanted, there is always the legacy nodes module. So you can go either way.

nath’s picture

It seems, we have to use the legacy modules anyway, as there is no context when using node panels?

merlinofchaos’s picture

This is an oversight, but at the moment yes, panel nodes don't have the context tab. I'll have to fix that.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

bomarmonk’s picture

Status: Closed (fixed) » Active

Could we add a context tab for panel nodes? I do need this feature (to add nodes to panel nodes) if I am not going to rely on legacy panels... thanks for the great work on panels 2. The drag and drop functionality is really nice.

najibx’s picture

This only allow me to add one node.
Even if in Context, I have added multipe, When I add in Content, it always show default.

How can i add more nodes to a panel the same behavior as the legacy?

cpelham’s picture

If I add multiple nodes in Context, and give each a different name, it works for me. On the Panels Content screen where one adds content via the Javascript GUI, if I then choose to add node content via context, then I see a dropdown box listing the names of teach of the nodes I originally added on the Context page.

It should be straightforward, but describing it is not straightforward because of the number of different places in Panels where one may click or select context or content.

sdboyer’s picture

Version: 5.x-2.0-beta1 » 5.x-2.x-dev
Component: User interface » Panel nodes
Assigned: Unassigned » sdboyer

Adding a context tab for panel nodes is on the docket for beta4. I'll post more updates here as I get to working on it.

sun’s picture

Status: Active » Closed (duplicate)

Marking as duplicate of #256456: Add context to panel nodes