Currently the 'left' area is used for the panels block. It would be better to enable users to select which area to use. This is particularly an issue if new layouts are added that don't include left. (All current layouts do include it.)

CommentFileSizeAuthor
#3 panelsblock_areas.patch3.17 KBrecidive
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers’s picture

By "users" you mean the "end-users", right? I.e. show multiple tabs, one for each area in the panel.

nedjo’s picture

Actually, no, I mean site admins.

I hadn't thought of the idea of having each of the panels be a tab. That would be a separate feature request issue.

recidive’s picture

Assigned: nedjo » recidive
Status: Active » Needs review
FileSize
3.17 KB

Here is a patch that does this. It adds a select to the panels form where users can choose what panel area they want to expose as a block. The question I have in mind is how to do with backward compatibility. For now I've changed PANELS_BLOCK_AREA to PANELS_BLOCK_DEFAULT_AREA, so if a exposed block doesn't have an area set, it will use the default.

nedjo’s picture

Status: Needs review » Reviewed & tested by the community

Nice, this looks great!

A small suggestion before you apply this. We should use the default area as the default if it exists. Here's an untested idea:


    $options = panelsblock_get_areas($form['layout']['#value']);

    $form['panelsblock']['expose_area'] = array(
      '#type' => 'select',
      '#title' => t('Display area'),
      '#default_value' => $blocks[$form['did']['#value']] && $blocks[$form['did']['#value']]['area'] ? $blocks[$form['did']['#value']]['area'] : (array_key_exists(PANELSBLOCK_DEFAULT_AREA, $options) ? PANELSBLOCK_DEFAULT_AREA : ''),
      '#options' => $options,
      '#description' => t('Select the area that will be displayed.'),
    );

Then we don't need to justify the inclusion of this constant--it has a purpose beyond the update. Otherwise, we'd need an update that set the area for each existing registered panelsblock.

recidive’s picture

Status: Reviewed & tested by the community » Fixed

Commited!

Anonymous’s picture

Status: Fixed » Closed (fixed)