I am having issue with displaying one field twice in my template having different display modes.
I have a content type basic page with field field_gallery (which is entity reference on paragraph). In template node--page--full.html.twig I want to render field_gallery twice. Once using default display mode and second using teaser.
<div class="container">
{# this as teaser #}
{{ content.field_gallery }}
{# this as default or whatever #}
{{ content.field_gallery }}
</div>
I tried do it using hook_preprocess_node, but could not achieve the result I want.
$variables['custom_display_mode'] = $variables['node']->get('field_gallery')
->view(array(
'label' => 'hidden',
'type' => 'teaser'
));
I do not want to use any custom module, I'm kinda new to drupal hooks and i'm sure that it must be possible somehow, to set custom variable and print it in my template.
Thanks.