|
|
|
@ -85,12 +85,14 @@ 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(); |
|
|
|
|
|
|
|
|
|
$variables['license_link'] = $referencedEntity->get('field_license_link')->first()->view(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Implementation of hook_preprocess_entity_embed_container(). |
|
|
|
|