To load a Panel display from the database we can use panels_load_display($did)
However, the $did
value is an autoincrement value from the database. It is not present in exported Panel page displays (e.g features export).
I thought perhaps we could use ctools_export_object_load
to load the exported panels display.
However, I found that it only returns a result if the display is in the panels_display
table in the database, and returns empty empty for exported code storage displays.
e.g:
// Attempt to load Panels display
ctools_include('export');
$uuid = '49c15c71-d5d1-d574-b539-0149f912f925';
$display = ctools_export_load_object('panels_display', 'conditions', array('uuid' => $uuid ));
var_export($display); // empty array if not in DB.
How can we load a Panel display in code when that display is exported in features and using code-based storage?
hook_default_page_manager_pages
I wonder if will need to load the panel page itself, then get the display from that. There doesn't appear to be a simple equivalent function to load exported panel displays. – David Thomas Oct 7 '15 at 22:27