Skip to content

Commit

Permalink
Update LayoutBase.php
Browse files Browse the repository at this point in the history
Update section background to use specific style (section_background)
  • Loading branch information
jnicholCU committed Sep 16, 2024
1 parent 48dc658 commit e1aee59
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Plugin/Layout/LayoutBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Layout\LayoutDefault;
use Drupal\media\Entity\Media;
use Drupal\image\Entity\ImageStyle;
use Drupal\file\Entity\File;


Expand Down Expand Up @@ -379,7 +380,8 @@ public function submitConfigurationForm(array &$form, FormStateInterface $form_s
if ($media_entity) {
$fid = $media_entity->getSource()->getSourceFieldValue($media_entity);
$file = \Drupal::entityTypeManager()->getStorage('file')->load($fid);
$url = $file->createFileUrl();
$path = $file->getFileUri();
$url = ImageStyle::load('section_background')->buildUrl($path);


$crop = \Drupal::service('focal_point.manager')->getCropEntity($file, 'focal_point');
Expand Down

0 comments on commit e1aee59

Please sign in to comment.