Export custom Page Manager page handlers

Public

By default you can only export custom Page Manager handlers as a whole in Features or Bulk Export. This little diddy tells Ctools to allow export of individual custom handlers.

</> CopyGet raw version
php
  1. /**
  2.  * Implements hook_ctools_plugin_pre_alter().
  3.  */
  4. function mahsauce_ctools_plugin_pre_alter(&$plugin, &$info) {
  5. // Allow page manager handlers to be exported. Handlers in the database or
  6. // exported to code will be exposed to Features.
  7. //
  8. // @note: The page must be declared through its specified hook, still.
  9. if ($plugin['module'] == 'page_manager' && $plugin['name'] == 'page') {
  10. $plugin['non-exportable'] = NULL;
  11. }
  12. }

Comments

ndf's picture

And with this ctools-patch, individual custom handlers won't be exported to 'page_manager_pages' anymore. This cannot be done without patching...

  1. diff --git a/ctools/page_manager/page_manager.module b/ctools/page_manager/page_manager.module
  2. index 7023752..79a682c 100644
  3. --- a/ctools/page_manager/page_manager.module
  4. +++ b/ctools/page_manager/page_manager.module
  5. @@ -1192,7 +1192,7 @@ function page_manager_page_manager_pages_to_hook_code($names = array(), $name =
  6. $code .= "function " . $name . "_{$export['default hook']}() {\n";
  7. foreach ($objects as $object) {
  8. // Have to implement our own because this export func sig requires it
  9. - $code .= $export['export callback']($object, TRUE, ' ');
  10. + $code .= $export['export callback']($object, FALSE, ' ');
  11. $code .= " \${$export['identifier']}s['" . check_plain($object->$export['key']) . "'] = \${$export['identifier']};\n\n";
  12. }
  13. $code .= " return \${$export['identifier']}s;\n";
mglaman's picture

But, that's kind of the point. Wanting them to be separate (since this is a hack)