0

I have a mini panel in which I need to delete few content panes and add new content pane programmatically without using features.

0

The pane can be added to the mini-panel's display by loading the mini-panel using panels_mini_load($minipanel_name); & then saving back the minipanel after attaching the pane to the display. Attaching example below:

$mini = panels_mini_load($minipanel_name);
  $uuid_display = ctools_uuid_generate();
  $display = new panels_display();
  $display->layout = 'holder';
  $display->layout_settings = array();
  $display->panel_settings = array(
    'style_settings' => array(
      'default' => NULL,
      'contents' => NULL,
    ),
  );
  $display->cache = array();
  $display->title = '';
  $display->uuid = $uuid_display;
  $display->content = array();
  $display->panels = array();

  foreach ($panes as $pane) {
    $display->content[$pane->pid] = $pane;
    $display->panels['contents'][] = $pane->pid;
  }
  $mini->display = $display;
  panels_mini_save($mini);
-1

If I understood correctly, I theorize this would be a way to do so:

After you edited the mini panel to your liking, you could create a Node dedicated TPL file in Drupal 7 (or a Twig in Drupal 8) that will represent the whole product and than embedding the mini panel you finalized as it's possible to embed it to a Theme tpl file; There you could edit its code to your liking.

If you prefer, from whatever reason, a solution without coding, Than you could create a Panel-Node (or a Panel-Page for that matter) and combine your already-edited mini-panel inside it (as a Panels addition), or outside it (as a block)... The module Features would be completely out of this process...

I am not sure about that, but there might be a way to combine Panels inside Views in Drupal 7 (Maybe via an external module); Thus you could combine the mini-panel inside a View also without coding, though it might be problematic in all that has to do with Mobile devices responsivness.

  • I am new to custom development and unable to understand this. However, Whatever I understood this may not be configurable. – kajal.kiran Jan 6 '16 at 9:01
  • So I understood "Programatically in a different way"; I will edit the question and add an alternative: If you liked, please thumbs up when the time comes :) – JohnDoea Jan 6 '16 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.