Adding nodes?

nath - January 4, 2008 - 15:38
Project:Panels
Version:5.x-2.x-dev
Component:Panel nodes
Category:support request
Priority:normal
Assigned:sdboyer
Status:duplicate
Description

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).

#1

merlinofchaos - January 4, 2008 - 16:47

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:

<?php
 
// 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.

#2

nath - January 7, 2008 - 08:53

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). :-\

#3

merlinofchaos - January 7, 2008 - 16:31
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.

#4

nath - January 10, 2008 - 09:12

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

#5

merlinofchaos - January 10, 2008 - 16:46

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

#6

Anonymous (not verified) - January 24, 2008 - 16:51
Status:fixed» closed

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

#7

bomarmonk - January 27, 2008 - 23:57
Status:closed» 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.

#8

najibx - April 8, 2008 - 14:37

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?

#9

cpelham - April 30, 2008 - 16:35

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.

#10

sdboyer - May 1, 2008 - 21:27
Version:5.x-2.0-beta1» 5.x-2.x-dev
Component:User interface» Panel nodes
Assigned to:Anonymous» 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.

#11

sun - September 12, 2008 - 23:27
Status:active» duplicate

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

 
 

Drupal is a registered trademark of Dries Buytaert.