drupal 7 creating panels 3 programatically

476 Views Asked by At

I'm writing custom module for Drupal 7 and I need to create a couple of panel pages with some panes with information. I've been searching and I've not found the way to programatically create a panel page, so it behaves like one done via admin interface and it appears in panels admin pages as well... Someone knows how to do it?

1

There are 1 best solutions below

0
user3563097 On

If you want to add any content to a pane/panel I suggest creating a drupal block and adding that block into the panel page.

If you just want to have your panel page in code you than you can create your panel page than export it -> you will have the code. Than you should create a file in your module folder like MODULNAME.pages_default.inc. Than Implement hook_default_page_manager_pages() in that file and add your exported code into it. Perhaps read doc for hook_default_page_manager_pages().