Panels 2: Overriding the node edit form
Panels 2 allows you to override the Node Edit Form. Why would you want to do that? Let's say, for example, you need to see all the comments on a node when you are editing it, and you also want the taxonomy editor on the right. Panels 2 allows you to configure the node edit form to be just the way you need it. The advantage is clear for developers and non-developers as well, as placing difference blocks in different places is all made through an easy to use UI.
Let's override the Edit form of all the story nodes and divide it into two columns. On the left will place the content form, and on the right the taxonomy editor as well as node comments.
- Make sure you've got Panels 2 installed
- Click Panel pages (Administer > Panels > Panel pages). At the top of the page, there are some tabs: click the 'Add' tab, which will bring you to a selection of possible panel layouts. Let's select a 'Two Column' panel.

- Set the Panel name to: override_node_edit
- Set the Page title to: Edit
- Set the Path to: node/%/edit

- Click next.
- From the tabs at the top, click 'Context'.
- In the arguments select list, select 'Node edit form' from the drop down menu and click 'Add argument'.
- A window will pop up; find the heading 'Node types' and enable the checkbox next to 'Story'. This means the panel will grab (i.e. override) all the nodes edit form of the story content type. If your main content type that you want to change is not called 'Story', substitute the other name for 'Story' from this step on.
- Press save at the bottom of the popup, and then save at the bottom of the page.

- Select the 'Content' tab at the top.
- On the left side, click the plus sign. A window should again pop up. Under the 'Form' heading, select 'General Form'. If you wish to restrict access to a specific user type, this window will allow you to (if you don't click any user types, access will not be restricted). Let's just click 'Add pane' for now. This inserts your standard node edit form onto the left half of the panel.
- On the right side, click the plus sign. A window should again pop up. Under the 'Form' heading, select 'Node form categories'. This adds a taxonomy editor onto the right side.
- Let's add the comments now. On the right side, click the plus sign again. Under the 'Node context' field, select 'Node comments'. Again, if you wish to restrict access, this window is the place to do that, but let's just click 'Add pane' for now. This inserts the comments on the node onto the right half of the panel.

- Save your panel.
- To test out the panel, go to some content, and click the 'Edit' tab at the top (the one you would normally click). Voila, Panels 2 has overridden the Node edit page!

- To create different edit form panels for different content types, you have to repeat step #8 and create two arguments (or however many content types you would like to override the form for). You should end up with arguments listed as "Node edit form," "Node edit form 2," etc. Each argument should be assigned to a different content type. You can also assign one argument to several content types but that's totally up to you. When editing each argument, make sure the content type(s) is checked in both "Node types" and "Own display."
- Click Save and go to the "Content" tab. There should be new tabs there and also in "Layout" and "Layout settings."
If you comprehend the steps above, you can skip the manual labor and import the panels, using the import tab at the top:
$page = new stdClass();
$page->pid = 'new';
$page->name = 'override_node_edit';
$page->title = 'Edit';
$page->arguments = array (
0 =>
array (
'name' => 'node_edit',
'default' => 'ignore',
'title' => '',
'id' => 1,
'identifier' => 'Node edit form',
'keyword' => 'node',
'argument_settings' =>
array (
'types' =>
array (
'story' => 'story',
'panel' => 0,
'page' => 0,
),
'own_default' => 0,
'displays' =>
array (
'story' => 0,
'panel' => 0,
'page' => 0,
),
),
),
);
$page->contexts = array();
$page->relationships = array();
$page->access = array();
$page->path = 'node/%/edit';
$page->css_id = '';
$page->css = NULL;
$page->no_blocks = '0';
$page->menu = '0';
$page->menu_tab = NULL;
$page->menu_tab_weight = NULL;
$page->menu_title = NULL;
$page->menu_tab_default = NULL;
$page->menu_tab_default_parent_type = NULL;
$page->menu_parent_title = NULL;
$page->menu_parent_tab_weight = NULL;
$display = new stdClass();
$display->did = 'new';
$display->name = NULL;
$display->layout = 'twocol';
$display->layout_settings = NULL;
$display->panel_settings = NULL;
$display->content = array();
$display->panels = array();
$pane = new stdClass();
$pane->pid = 'new-1';
$pane->panel = 'left';
$pane->type = 'form';
$pane->subtype = 'node_type';
$pane->access = array();
$pane->configuration = array (
'context' => 'argument_node_edit_1',
'override_title' => 0,
'override_title_text' => '',
'css_id' => '',
'css_class' => '',
);
$display->content['new-1'] = $pane;
$display->panels['left'][0] = 'new-1';
$pane = new stdClass();
$pane->pid = 'new-2';
$pane->panel = 'right';
$pane->type = 'node_form';
$pane->subtype = 'taxonomy';
$pane->access = array();
$pane->configuration = array (
'context' => 'argument_node_edit_1',
'override_title' => 0,
'override_title_text' => '',
'css_id' => '',
'css_class' => '',
'id' => 'taxonomy',
);
$display->content['new-2'] = $pane;
$display->panels['right'][0] = 'new-2';
$pane = new stdClass();
$pane->pid = 'new-3';
$pane->panel = 'right';
$pane->type = 'node_comments';
$pane->subtype = 'comments';
$pane->access = array();
$pane->configuration = array (
'context' => 'argument_node_edit_1',
'override_title' => 0,
'override_title_text' => '',
'css_id' => '',
'css_class' => '',
'mode' => '4',
'order' => '2',
'comments_per_page' => '50',
);
$display->content['new-3'] = $pane;
$display->panels['right'][1] = 'new-3';
$page->display = $display;
$page->displays = array();
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