How can I link the file name to the file? I created a content type with a &quot;file&quot; field type. This to upload a pdf file.
Now I want to create a link to open that specific file, in my twig.
If I do this :  &lt;div&gt;{{content.field_menukaart}}&lt;/div&gt;, it opens my file correctly. But I want another link text other than my filename. For example &quot;open here&quot;.
This is where I get stuck. How could I do this ?
This is not working :  &lt;div&gt;&lt;a href=&quot;{{content.field_menukaart}}&quot;&gt;open here&lt;/a&gt;&lt;/div&gt;
Thank you for your help,
Basiel
You can solve by implementing a preprocess function
/themes/mytheme/mytheme.theme
&lt;?php

/**
 * Implements hook_preprocess_HOOK().
 */
function mytheme_preprocess_file_link(&amp;$variables) {
  $variables['link']['#title'] = t('Open Here'); // change title
  $variables['link']['#url']-&gt;setOption('attributes', ['target' =&gt; '_blank']); // open in a new browser tab
}

Rename mytheme to your actual theme name and clear/flush caches so hook gets picked up.