Created
May 6, 2014 21:54
-
-
Save dsnopek/4de040f197087f5fbe47 to your computer and use it in GitHub Desktop.
Shows how to modify the Panels display on a node.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$nid = 123; | |
$node = node_load($nid); | |
$display =& $node->panelizer['page_manager']->display; | |
foreach ($display->content as $pid => $pane) { | |
if ($pane->uuid == 'd195a038-1e7d-45e7-9232-22e4c6f4da3e') { | |
$display->content[$pid]->configuration['path'] = 'blerg'; | |
} | |
} | |
// This will trigger Panelizer to clone the default and create a custom Panel if one | |
// doesn't already exist. | |
$node->panelizer['page_manager']->display_is_modifed = TRUE; | |
// When this is already a custom panel, we need to save the Panel ourselves. | |
if ($node->panelizer['page_manager']->did) { | |
panels_save_display($display); | |
} | |
node_save($node); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment