I'm having a bit of an issue getting panels working in D7. When I use the layout designer, I am unable to adjust the region widths. When I try to adjust them, the layout designer gets squeezed over into a corner, and the columns aren't resizing properly, (they just keep getting bigger and bigger). I was using Panels 7.3 alpha1 and just upgraded to the latest dev, and am still getting the same problem. I've also tried clearing out browser caches, clearing drupal caches, and using this in both Chrome and Firefox. Any idea what could be causing this?

Comments

Jamie Holly’s picture

Priority: Normal » Major

I am also experiencing the same problem. This seems like a rather major issue given the popularity of the flexible layouts.

Jamie Holly’s picture

Here is the saved code from an export of a panel causing this issue. The problem is that it's adding the div tags around the width on the left region. I can actually fix that in a text editor and reimport the variant, then it works fine. I can even use the editor to adjust the widths with no problem.


$handler = new stdClass;
$handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
$handler->api_version = 1;
$handler->name = 'page_front_page_panel_context_2';
$handler->task = 'page';
$handler->subtask = 'front_page';
$handler->handler = 'panel_context';
$handler->weight = 1;
$handler->conf = array(
  'title' => 'Landing page',
  'no_blocks' => FALSE,
  'pipeline' => 'ipe',
  'css_id' => '',
  'css' => '',
  'contexts' => array(),
  'relationships' => array(),
);
$display = new panels_display;
$display->layout = 'flexible';
$display->layout_settings = array(
  'items' => array(
    'canvas' => array(
      'type' => 'row',
      'contains' => 'column',
      'children' => array(
        0 => 'main',
      ),
      'parent' => NULL,
    ),
    'main' => array(
      'type' => 'column',
      'width' => 100,
      'width_type' => '%',
      'children' => array(
        0 => 'main-row',
        1 => 1,
      ),
      'parent' => 'canvas',
    ),
    'main-row' => array(
      'type' => 'row',
      'contains' => 'region',
      'children' => array(
        0 => 'center',
      ),
      'parent' => 'main',
    ),
    'center' => array(
      'type' => 'region',
      'title' => 'Top',
      'width' => 100,
      'width_type' => '%',
      'parent' => 'main-row',
      'class' => '',
    ),
    1 => array(
      'type' => 'row',
      'contains' => 'region',
      'children' => array(
        0 => 'left',
        1 => 'right',
      ),
      'parent' => 'main',
      'class' => '',
    ),
    'left' => array(
      'type' => 'region',
      'title' => 'Left',
      'width' => '<div>50</div>',
      'width_type' => '%',
      'parent' => '1',
      'class' => '',
    ),
    'right' => array(
      'type' => 'region',
      'title' => 'Right',
      'width' => '60.101010101010104',
      'width_type' => '%',
      'parent' => '1',
      'class' => '',
    ),
  ),
);
$display->panel_settings = array(
  'style_settings' => array(
    'default' => NULL,
    'center' => NULL,
    'left' => NULL,
    'right' => NULL,
  ),
);
$display->cache = array();
$display->title = 'Front Page';
$display->content = array();
$display->panels = array();
  $pane = new stdClass;
  $pane->pid = 'new-1';
  $pane->panel = 'center';
  $pane->type = 'views_panes';
  $pane->subtype = 'fp_promo-panel_pane_1';
  $pane->shown = TRUE;
  $pane->access = array();
  $pane->configuration = array();
  $pane->cache = array();
  $pane->style = array(
    'settings' => NULL,
  );
  $pane->css = array();
  $pane->extras = array();
  $pane->position = 0;
  $display->content['new-1'] = $pane;
  $display->panels['center'][0] = 'new-1';
$display->hide_title = PANELS_TITLE_FIXED;
$display->title_pane = 'new-1';
$handler->conf['display'] = $display;
Jamie Holly’s picture

Another update. You can get the editor to work if you add your regions, then save the panel. After that you can resize the regions properly. The problem seems to be on the initial save of newly created regions.

NathanM’s picture

Thanks for the tip. I'll give that a try.

NathanM’s picture

That worked. Thanks once again.

merlinofchaos’s picture

Title: Issue with Panels Layout Designer in 7.x » Resizing regions with flexible layout causes
Status: Active » Fixed
StatusFileSize
new3.91 KB

This was some javascript problems due to D7 AJAX framework updates. Patch attached fixes it, and is now committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

summit’s picture

Hi, I think this problem also occurs on D6, right? Will add D6 issue for it.
EDIT: see http://drupal.org/node/1411732
Greetings, Martijn

Anonymous’s picture

thank you it did work for me.

  • Commit b6e6a3f on 7.x-3.x, master, pipelines, 7.x-3.x-i18n, 8.x-3.x by merlinofchaos:
    #987902: Fix flexible layout splitter resize brokenness.