You are here

function hook_panels_ipe_layouts_alter in Panels 8.4

Modify the list of layouts available through the IPE interface.

Parameters

array $layouts: The layouts that are currently available.

\Drupal\panels\Plugin\DisplayVariant\PanelsDisplayVariant $panels_display: The current Panels display.

1 invocation of hook_panels_ipe_layouts_alter()
PanelsIPEPageController::getLayoutsData in panels_ipe/src/Controller/PanelsIPEPageController.php
Gets a list of available Layouts as a data array.

File

panels_ipe/panels_ipe.api.php, line 55
Hooks specific to the Panels IPE module.

Code

function hook_panels_ipe_layouts_alter(array &$layouts, PanelsDisplayVariant $panels_display) {

  // Only show layouts that are in the 'threecol' category.
  foreach ($layouts as $key => $layout) {
    if ($layout['category'] !== 'threecol') {
      unset($layout[$key]);
    }
  }
}