Skip to content
Snippets Groups Projects
Commit 1191ee25 authored by Brooke Stevens's avatar Brooke Stevens
Browse files

Issue #3410576: Fix PHP warnings on Layout builder when no icons are uploaded

parent 04e3bfe2
No related branches found
No related tags found
1 merge request!4Issue #3410576: Fix PHP warnings on Layout builder when no icons are uploaded
# Paragon Gin
Gin and Layout builder improvements intended to be used on Paragon sites. The goal of these improvements is to make
the authoring experience better.
## Required modules
- Gin
- Gin LB
- Paragon Core
## Recommended Modules
- Layout Builder Browser
## Features
### Layout Builder
- Adds Gin theme setting for toggling between icon + list view of blocks
- Tooltip to show block type when hovering on layout builder
- Various layout builder style improvements
- Refined top menu with "View Edit Layout Builder Version History" shortcuts
- Update titles of inline blocks with the field_heading value if possible
## Known Issues
- Does not work with Layout Builder browser. When adding a new block, configure form appears in sidebar
- Removes the block search bar becuase it doesn't work
Paragon Gin
......@@ -5,7 +5,7 @@
position: sticky;
top: 0;
background: white;
z-index: 2;
z-index: 5;
padding: 0 1rem;
padding-bottom: 1rem;
}
......@@ -107,6 +107,7 @@
display: flex;
gap: 1rem;
flex-wrap: wrap;
width: 100%;
}
.paragon-gin-browser-wrapper[data-view='icon'] > .paragon-gin-card {
......@@ -114,6 +115,10 @@
}
.paragon-gin-browser-wrapper[data-view='icon'] .card-img {
height: 180px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px 4px 0 0;
background: var(--gin-border-color);
overflow: hidden;
......@@ -121,6 +126,9 @@
.paragon-gin-browser-wrapper[data-view='icon'] img {
width: auto;
height: 100%;
object-fit: contain;
object-position: center;
}
.paragon-gin-browser-wrapper[data-view='icon'] .card-content {
......
......@@ -85,8 +85,12 @@ function paragon_gin_layout_builder_browser_alter(array &$build, array $context)
$build['block_categories'][$category]['links'][$index]['#theme'] = 'paragon_gin_lb_browser_block';
// Set the variables.
$build['block_categories'][$category]['links'][$index]['#label'] = $settings['#title']['label'];
$build['block_categories'][$category]['links'][$index]['#description'] = $settings['#title']['description'];
$build['block_categories'][$category]['links'][$index]['#image'] = $settings['#title']['image'];
if (isset($settings['#title']['description'])) {
$build['block_categories'][$category]['links'][$index]['#description'] = $settings['#title']['description'];
}
if (isset($settings['#title']['image'])) {
$build['block_categories'][$category]['links'][$index]['#image'] = $settings['#title']['image'];
}
}
}
// Attach the CSS/JS.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment