Skip to content

Instantly share code, notes, and snippets.

@larowlan
Created April 22, 2015 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larowlan/da2162c6442e5a0237a7 to your computer and use it in GitHub Desktop.
Save larowlan/da2162c6442e5a0237a7 to your computer and use it in GitHub Desktop.
Create an FPP in an install hook
<?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