|
|
|
@ -85,11 +85,13 @@ function media_attribution_preprocess_field__paragraph__field_attribution_author
|
|
|
|
|
|
|
|
|
|
function media_attribution_preprocess_paragraph__license_attribution__license_attribution(&$variables) { |
|
|
|
|
$variables['license_prefix'] = \Drupal::translation()->translate('Licensed under'); |
|
|
|
|
$items = $variables['elements']['field_license']['#items']; |
|
|
|
|
if (!empty($items)) { |
|
|
|
|
$referencedEntity = $variables['elements']['field_license']['#items'] |
|
|
|
|
->first()->get('entity')->getTarget()->getValue(); |
|
|
|
|
|
|
|
|
|
$referencedEntity = $variables['elements']['field_license']['#items'] |
|
|
|
|
->first()->get('entity')->getTarget()->getValue(); |
|
|
|
|
|
|
|
|
|
$variables['license_link'] = $referencedEntity->get('field_license_link')->first()->view(); |
|
|
|
|
$variables['license_link'] = $referencedEntity->get('field_license_link')->first()->view(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -181,4 +183,4 @@ function media_attribution_theme() {
|
|
|
|
|
'base hook' => 'field', |
|
|
|
|
], |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|