Skip to content

Commit

Permalink
remove layout restriction for now
Browse files Browse the repository at this point in the history
  • Loading branch information
protitude committed Jun 12, 2024
1 parent 50dd19b commit c402e05
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion oit.layouts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ layout_left_sidebar_section:
content:
label: Content area
layout_both_sidebar_section:
label: 'Both sidebar'
label: 'Both sidebars'
path: layouts/both_sidebar_section
template: layout--both-sidebar-section
library: oit/both_sidebar_section
Expand Down
19 changes: 19 additions & 0 deletions oit.module
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,25 @@ function oit_menu_local_tasks_alter(&$data, $route_name) {
}
}

/**
* Implements hook_layouts_alter().
*/
function oit_layout_alter(&$definitions) {
// an array of layouts to keep
$layoutsWhitelist = ['layout_onecol'];

// layouts that are required and cannot be removed
$requiredLayouts = ['layout_right_sidebar_section', 'layout_left_sidebar_section', 'layout_both_sidebar_section'];

$layouts = array_merge($requiredLayouts, $layoutsWhitelist);

$definitions = array_filter(
$definitions,
static fn(string $id) => in_array($id, $layouts, true),
ARRAY_FILTER_USE_KEY
);
}

/**
* Implements hook_block_access().
*/
Expand Down

0 comments on commit c402e05

Please sign in to comment.