Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
layout_builder_customizer
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
layout_builder_customizer
Commits
1cb6eee3
Commit
1cb6eee3
authored
4 years ago
by
Neslee Canil Pinto
Browse files
Options
Downloads
Patches
Plain Diff
Functionality for displaying layout option in content listing page
parent
e6dbd327
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.txt
+3
-1
3 additions, 1 deletion
README.txt
layout_builder_customizer.info.yml
+2
-1
2 additions, 1 deletion
layout_builder_customizer.info.yml
layout_builder_customizer.module
+25
-0
25 additions, 0 deletions
layout_builder_customizer.module
with
30 additions
and
2 deletions
README.txt
+
3
−
1
View file @
1cb6eee3
...
...
@@ -15,8 +15,10 @@ Allows user to customize Layout Builder Options.
1. If Disable option is checked in module configuration form, This module
disables option "Allow each Entity Type to have its layout customized"
in Manage Display Page for Respective Entity Type.
2.
Module g
ives user quick links(Configure, Move and Remove Block) on hover
2.
G
ives user quick links(Configure, Move and Remove Block) on hover
of its particular block, which will save users time.
3. Adds a 'Layout' operation link to Layout Builder content on content listing
pages.
REQUIREMENTS
...
...
This diff is collapsed.
Click to expand it.
layout_builder_customizer.info.yml
+
2
−
1
View file @
1cb6eee3
name
:
'
Layout
Builder
Customizer'
description
:
'
Allows
user
to
customize
Layout
Builder.'
core_version_requirement
:
^8.8 || ^9
type
:
module
package
:
Layout Builder
core_version_requirement
:
^8.8 || ^9
configure
:
layout_builder_customizer.settings_form
dependencies
:
-
drupal:layout_builder
This diff is collapsed.
Click to expand it.
layout_builder_customizer.module
+
25
−
0
View file @
1cb6eee3
...
...
@@ -5,7 +5,9 @@
* Layout Builder Customizer module file.
*/
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\Core\Url
;
/**
* Implements hook_form_alter().
...
...
@@ -31,6 +33,29 @@ function layout_builder_customizer_form_alter(&$form, FormStateInterface $formSt
}
}
/**
* Implements hook_entity_operation().
*/
function
layout_builder_customizer_entity_operation
(
EntityInterface
$entity
)
{
$account
=
\Drupal
::
currentUser
();
$entity_type_id
=
$entity
->
getEntityTypeId
();
$route_name
=
"layout_builder.overrides.
$entity_type_id
.view"
;
$route_parameters
=
[
$entity_type_id
=>
$entity
->
id
(),
];
$access_manager
=
\Drupal
::
service
(
'access_manager'
);
if
(
!
$access_manager
->
checkNamedRoute
(
$route_name
,
$route_parameters
,
$account
))
{
return
;
}
return
[
'Layout'
=>
[
'title'
=>
t
(
'Layout'
),
'weight'
=>
50
,
'url'
=>
Url
::
fromRoute
(
$route_name
,
$route_parameters
),
],
];
}
/**
* Implements hook_page_attachments_alter().
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment