Skip to content

Commit

Permalink
ELA-892: Make oe_list_item_block translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
libetho committed Nov 16, 2023
1 parent d004562 commit fa13bd5
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,11 @@ function oe_whitelabel_preprocess_paragraph__oe_list_item_block(array &$variable
$variables['columns'] = ['two_columns' => '2', 'three_columns' => '3'][$layout_name] ?? '1';

$variables['items'] = [];
foreach ($variables['paragraph']->get('field_oe_paragraphs') as $card_paragraph_item) {
foreach ($variables['paragraph']->get('field_oe_paragraphs') as $sub_paragraph) {
/** @var \Drupal\paragraphs\ParagraphInterface $card_paragraph */
$card_paragraph = $card_paragraph_item->entity;
// Get the paragraph translation.
$card_paragraph = \Drupal::service('entity.repository')
->getTranslationFromContext($sub_paragraph->entity, $paragraph->language()->getId());
$card_image_item = $card_paragraph->get('field_oe_image')->first();
$card_image = $card_image_item ? ImageValueObject::fromImageItem($card_image_item) : NULL;

Expand Down

0 comments on commit fa13bd5

Please sign in to comment.