Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
twigsuggest
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
twigsuggest
Commits
01c06367
Commit
01c06367
authored
Jan 31, 2023
by
Damien McKenna
Committed by
Benjamin Melançon
Jan 31, 2023
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3243842
by DamienMcKenna, naresh_bavaskar, mlncn: Block template suggestion per bundle
parent
414700f2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
twigsuggest.module
+3
-0
3 additions, 0 deletions
twigsuggest.module
with
3 additions
and
0 deletions
twigsuggest.module
+
3
−
0
View file @
01c06367
...
...
@@ -25,6 +25,9 @@ function twigsuggest_theme_suggestions_block(array $variables) {
if
(
isset
(
$variables
[
'elements'
][
'#id'
])
||
!
empty
(
$variables
[
'elements'
][
'#id'
]))
{
if
(
$block
=
Block
::
load
(
$variables
[
'elements'
][
'#id'
]))
{
if
(
isset
(
$variables
[
'elements'
][
'content'
][
'#block_content'
]))
{
$suggestions
[]
=
'block__bundle__'
.
$variables
[
'elements'
][
'content'
][
'#block_content'
]
->
bundle
();
}
$suggestions
[]
=
'block__'
.
$block
->
getRegion
();
$suggestions
[]
=
'block__'
.
$block
->
getRegion
()
.
'__'
.
$variables
[
'elements'
][
'#id'
];
if
(
$block
->
get
(
'settings'
)
&&
$provider
=
$block
->
get
(
'settings'
)[
'provider'
])
{
...
...
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
sign in
to comment