Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedThe 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:
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.
Comment #2
nath CreditAttribution: nath commentedThank 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). :-\
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedIf the additional power is not needed or not wanted, there is always the legacy nodes module. So you can go either way.
Comment #4
nath CreditAttribution: nath commentedIt seems, we have to use the legacy modules anyway, as there is no context when using node panels?
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedThis is an oversight, but at the moment yes, panel nodes don't have the context tab. I'll have to fix that.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #7
bomarmonk CreditAttribution: bomarmonk commentedCould 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.
Comment #8
najibx CreditAttribution: najibx commentedThis 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?
Comment #9
cpelham CreditAttribution: cpelham commentedIf 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.
Comment #10
sdboyer CreditAttribution: sdboyer commentedAdding 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.
Comment #11
sunMarking as duplicate of #256456: Add context to panel nodes