Created
April 22, 2015 23:37
-
-
Save larowlan/da2162c6442e5a0237a7 to your computer and use it in GitHub Desktop.
Create an FPP in an install hook
This file contains 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
<?php | |
/** | |
* Creates an FPP. | |
*/ | |
function mymodule_update_7001() { | |
$values = array( | |
'title' => 'Title seen in front end', | |
'admin_title' => 'Title seen in back end', | |
// Make this the machine name of the FPP type. | |
'bundle' => 'mypane_type', | |
// Make your own UUID with uuidgen on cli or use | |
// the value from your exported page-manager page. | |
'uuid' => '5495A31E-F3E2-4FB4-9642-03FB62368951', | |
// Add fields as required. | |
'field_pane_body' => array( | |
LANGUAGE_NONE => array( | |
array( | |
'value' => '<p>This is a rich-text field</p>', | |
'format' => 'filtered_html', | |
), | |
), | |
), | |
); | |
$fpp = entity_create('fieldable_panels_pane', $values); | |
entity_save('fieldable_panels_pane', $fpp); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment